Quote:
Originally Posted by qwertyp
Well, I did that, and I got no errors, but when the button is pushed the program crashes. I didn't have a viewWillAppear method, so I put the initialization in viewDidLoad.
|
Sorry, arrayWithCapacity returns an array that gets "autoreleased" - the usual way to deal with this is to create a "property" and use that to retain the object. If you haven't learned about properties yet, try this instead:
Code:
//for your .h file, between the interface brackets{}
NSMutableArray* array;
//for your .m file, in initWithNib or viewWillAppear
array = [[NSMutableArray alloc] init];