0

我一直在尝试在我的 iphone 项目中使用 AHALertView,但它不起作用。即使我运行 AHAlertView 的示例项目,它也无法编译并显示多达 13 个错误,显示“未声明使用标识符”和其他警告. 有没有人遇到过这样的问题?如果是,我该如何解决?

这是代码: -

- (IBAction)addEmail:(id)sender 
{  
      AHAlertView *addFriendAlertView = [[AHAlertView alloc]initWithTitle:@"Add New Contact" message:@"Enter New E-mail"];
      addFriendAlertView.alertViewStyle = AHAlertViewStylePlainTextInput;

      [addFriendAlertView setCancelButtonTitle:@"Cancel" block:^{
      NSLog(@"User cancelled the alert instead of entering new address");
 }];

      [addFriendAlertView addButtonWithTitle:@"OK" block:^{
      NSLog(@"User entered the email :- %@",[addFriendAlertView textFieldAtIndex:0].text); 
 }];

      [addFriendAlertView show];
4

1 回答 1

0

如果您没有使用最新的 XCode 版本,则需要显式合成此属性,例如

@synthesize presentationStyle = _presentationStyle; etc........
于 2013-05-25T12:01:10.807 回答