Browsed by
Month: May 2016

[iOS] – Create API wrapper with AFNetworking ?>

[iOS] – Create API wrapper with AFNetworking

Okay, so why AFNetworking? Well, this is a small quote from github: Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. That’s enough for a library right? Let’s start! 1. Installation There are some way to install the library, I choose the Pods method because it’s simple and easy to upgrade after….

Read More Read More

[iOS] – Prevent wrong loading image inside of TableViewCell when scrolling. ?>

[iOS] – Prevent wrong loading image inside of TableViewCell when scrolling.

My current project require a screen which contain a list view on it. Each item of that list will show the information of a drug store and there is a image on it too. It’s really simple. In iOS we just need to drag a UITableView to the controller, add a UITableViewCell to it, create a Cell class for that cell and finally inside the cellForRowAtIndexPath we just fill data for that cell.  Okay, everything work well but… until you scroll the list…

Read More Read More

[PHP] – json_decode() for big integers ?>

[PHP] – json_decode() for big integers

json_decode() is use for decode a json text to object (or array) in PHP. For normal case, below code will decode a json string to an array in PHP:

But if the json contain a really big integers then the problem will be appear, take a look at below code:

The result will be:

So the solution here is we need to tell the json_decode function that we need to convert the big integers to string. Something like…

Read More Read More