Hey guys, just had a question about UIAlertViews.
I have a button within a cell, and I wish to push an object’s data into the UIAlertView body section. Right now I have this:
- (void)locationButton:(id)selector{
NSString *addressBody = [NSString stringWithFormat:@"%@", [[testList objectAtIndex:selectedCellIndexPath.row] address]];
UIAlertView *addressView = [[UIAlertView alloc] initWithTitle:nil
message:addressBody
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Show on Map", nil];
[addressView show];
[addressView release];
}
Within the viewDidLoad, I initialized my Conference class like
testList = [[NSMutableArray alloc] init];
Conference *conf1 = [[Conference alloc] initWithConferenceId:110];
Conference *conf2 = [[Conference alloc] initWithConferenceId:130];
[testList addObject:conf1];
[testList addObject:conf2];
however when the button is pushed, the alert view does not display and it will eventually crash with
“Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[Conference address]: unrecognized selector sent to instance 0x5e273a0′”
Any suggestions?
In your
Conferenceclass, there is noaddressmethod implemented.This could just be a spelling mistake in the implementation. But it would be more helpful if you posted code in your Conference class.