Category Archives: Objective-C

Tip: Ensuring ARC is Enabled at Compile Time.

If you still have legacy code around that is not compiled with Automatic Reference Counting (ARC), accidentally adding some new code that assumes that ARC is enabled can lead to extensive memory leaks. This simple test, placed in a .m … Continue reading

Posted in Code, Code Snippets, Objective-C, Tips | Tagged , , | Leave a comment

Introduction to Properties in Objective-C

Properties in Objective-C allow you to provide a well-defined interface for other classes to manipulate (i.e. get or set) attributes of a class. They also insulate external classes from the implementation details of the attributes (this separation of function and … Continue reading

Posted in Objective-C | 2 Comments

The init and dealloc idioms.

For C++ programmers the first surprise waiting for them in Objective-C is that in a derived class they must explicitly call the init and dealloc methods of the superclass (roughly the equivalent of a constructor and destructor). By following the … Continue reading

Posted in Objective-C | Tagged , , , | Leave a comment