Reputation: 1227
I wanted to contribute something back, since everyone here has been so responsive. I was getting the above error on an action "button". It was driving me crazy. You see I have a master/detail template and I added an extra detail view to my project. I had a button on the second detail view, but not on the first. I took all of the code out of the button action and still received the error, so I added the same button to the first detail view ... and what do you know it worked.
-(IBAction) addData_btn: (sender){
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:AcctName.text];
[array addObject:AcctNum.text];
[array addObject:DayDue.text];
[array addObject:paymnt.text];
[array addObject:remBalance.text];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES);
NSString *documentPath = [paths objectAtIndex:0];
NSString *plistPath = [documentPath stringByAppendingPathComponent:@"Accounts.plist"];
[array writeToFile:plistPath atomically: true];
}
I added same button to first detail view, without any code ... it worked.
Upvotes: 0
Views: 3485
Reputation: 469
Make sure that, on Interface Builder, you didn't left any connections on buttons to actions that do not exist on their correspondent ViewControllers. Or else, the button, when touched, will try to call a method that doesn't exists, throwing this exception.
Upvotes: 1
Reputation: 1227
if your issue is happening where you have more than one detailViewControllers ... add same button or fields to the other detailViewcontroller. it should take care of issue. Good Luck
Upvotes: 0