Working in a team, I often find myself trying to avoid using Interface Builder (IB) as much as possible. This is because trying to resolve the inevitable conflicts that arise when two developers change the same xib can be soul-destroying ⚰️. A sea of seemingly unrelated xml changes awaits anyone wh…
I use the below category when working with dynamic content. It has useful methods for setting up a UILabel frame based upon its content and restrictions that you place on it. .h @interface UILabel(Size) /* @method Adjusts UILabel's frame to begin at defined x and y position and have a dynam…
I sometimes find myself creating applications that have a Home viewcontroller and all other views should allow the user to directly return to this Home viewcontroller. I don't just want to push a fresh copy of the Home viewcontroller on the navigation stack. Instead, I need to loop through the n…
I'm often asked to explain Core Data to the new joiners. I thought I'd share what I tell them about the components that make up Core Data: 1. Persistent store - is where Core Data stores its data, more often in a form of a SQLLite database but can be Atomic (binary store) or In-Memor…
A common want in any application that communicates with a web service is to add a loading/loader view to show your user that the application is busy getting data and has not crashed. I've came up with a generic loading view that I use on multiple applications, its split into two methods, one to…
Objective-C automatically passes two hidden method arguments with ever method call: * self - the object that the method is executing inside * _cmd - method's message call Here's an example of using _cmd: NSLog(@"%@", NSStringFromSelector(_cmd));…
When editing legacy code you sometimes come across the scenario where a getter and setter method has been created that performs the same job as a property would but a property wasn’t used. So you decide to tidy it and create a property for that instance variable. However the getter and setter don’t…
A colleague recently came to me with a bug in his code, that he just couldn’t solve. He was attempting to call a static/class method from inside an instance method of his class using self, assuming that as self was an instance of the class it would have access to all the methods defined in that clas…
When using the debugger within Xcode, you see that each object has a isa variable. For those, like me, curious about what is does. When you use alloc on a class, you are actually creating space in memory which is temporary filled, at the bottom of this space you point to another memory address. Th…