0

这段代码创建 UIActionSheet 有什么问题?它在抱怨委托:自我,但我不知道为什么。这是我的代码:

-(IBAction)SocialButtonPressed:(id)sender{    
    UIActionSheet *social = [[UIActionSheet alloc]initWithTitle:@"Share" 
                                                       delegate:self 
                                              cancelButtonTitle:@"Cancel"
                                         destructiveButtonTitle:@"Twitter" 
                                              otherButtonTitles:@"Facebook", @"iMessage", @"Mail", nil];

    [social showInView:self.view];
}
4

1 回答 1

2

使您的类符合该协议:

@interface MyClass : NSObject <UIActionSheetDelegate>
于 2013-03-29T13:03:00.410 回答