August 15, 2011 —
Anonymous
If you’ve tried doing something like this:
NSDictionary myDictionary = …
then you’ll run into this error code:
error: Semantic Issue: Interface type cannot be statically allocated
You need to declare a pointer to the instance variable. The correct code is:
NSDictionary *myDictionary = …
July 31, 2011 —
Anonymous
Property Lists – plists – are a standard way of storing data in iPhone and MacOS programs. Here’s how you use them on the iPhone.
NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"dwarves" ofType:@"plist"];
NSDictionary *plistDict = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
// use plistDict
[plistPath release];
[plistDict release];