Simulate Bad Network Connection in iOS Device and Simulator

While developing an app that requires an internet connection, it is very important to handle use-cases when the connection is slow or non-existent. To figure out when there’s a bad connection via your code, you can use this great Reachability library.

Once Reachability is implement it, it’s pretty easy to test it by simulating a bad connection on your iPhone or iPhone Simulator if you know what tools to use. Here is how you can test a your app on different internet connections using your iPhone and iPhone Simulator:

 

Continue reading

Get property name as string

Go to get the name of an object property, can be boring using the Objective-C runtime reference.
Fortunately there is a quick way to get it. Assume that you have an object named “appleStore” that has a property named “storeLocation”.
StoreLocation is another object with some properties: “city”, “lat”, “lon”, “street”, “state”, “code”.

Continue reading

Manage Development and Production Builds

For starters, some of you may be wondering why you should use two builds while developing your app. The reason is because as you continue to build new features, you want to separate the development version from the existing public production app. Standard software development practice is to use different environments for the different versions of the software. The development version of an app typically uses a different database and server from the production environment. Developers commonly use dummy images or data during testing. In testing or development environments, it’s not uncommon for one to use test data such as “test comment”, “argharghargh” and “one more test comment”. Obviously, you don’t want your real users to see this kind of messages. In the case, if your app using an analytics system, you may even send thousands of events during the testing stage. Again, you don’t want to mix the test data with the production data in the same database. This is why it’s always recommended to separate the development and production builds.

Continue reading