开发者

Issues with alert view, 'delegate' undeclared error

开发者 https://www.devze.com 2023-01-23 15:44 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消