Issues with alert view, 'delegate' undeclared error
This may be a school boy error, but I am trying to embed a UIAlertView after someone selects a contact property in the peoplePickerNavigationController that is NOT an address. What am I doing wrong to get a 'delegate' undeclared error! Could someone tell me conceptually why this is not working as I have made self a UIAlertViewDelegate and done the right things! Thanks in Advance :-)
- (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier {
UIAlertView *alert;
if (property == kABPersonAddressProperty)
NSLog(@"ZOMG YOU PRESSED FOR AN ADDRESS!!"开发者_运维知识库);
else {
alert = [UIAlertView alloc];
[alert initWithTitle:@"Invalid Address" message:@"Please pick an address from a contact": delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
[self dismissModalViewControllerAnimated:YES];
return NO;
}
You've got an extra : here-
message:@"Please pick an address from a contact": delegate:self
精彩评论