- When to call [super someMethod]? Apple documents the subclasser's responsibility, but a quick heuristic is to call [super someMethod] first, in methods that construct or initialize things, and call [super someMethod] last in methods that are tidying up, shutting down or deallocating things.
- To convert an integer to a string: [NSString stringWithFormat: @"%d", someInt]
- [NSArray array] is a shorter way of doing [[[NSArray alloc] init] autorelease]
- When building older projects, sometimes the linked frameworks are awry. I remove all linked frameworks then try to re-add them. The wrong way of doing this is to right-click the Frameworks folder and add that way. The right way of doing this is to open up the target, double-click to get the 'General' tab. At the bottom, there's 'Linked Libraries' and a (+) icon at the bottom. Add them this way instead. Make sure you add Foundation.framework and UIKit.framework.
- NSNumber is an object NSInteger is just a typedef for a primitive type. NSNumber will work with collections. To convert from primitive to NSNumber, just use the appropriate init: [NSNumber numberWithFloat:someFloat]
- When you need a singleton, use Matt's macro to make creating them easy. I sometimes use singletons as an entry point into a single Model for an app.
Aperture 3 Was My Idea….
1 hour ago




