Quote:
Originally Posted by NewiPhoneDeveloper
Hi,
I tried what you suggested and it really makes sense to me, but still "TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION".
Here is what I did:
Code:
//this is MainViewController.m (NSMutable array is already declared in .h)
myNSMutableArray = [[[NSMutableArray alloc] initWithObjects:@"object1.png", @"object2.png", @"object3.png"]retain];
- (void)ReplaceOneOfMyObjects {
[myNSMutableArray replaceObjectAtIndex:0 withObject:@"object4.png"];
}
[self ReplaceOneOfMyObjects];
|
"nil" is missing:
Code:
myNSMutableArray = [[NSMutableArray alloc] initWithObjects: @"object1.png", @"object2.png", @"object3.png", nil];