创建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];
}
答案 0 :(得分:2)
让您的课程符合该协议:
@interface MyClass : NSObject <UIActionSheetDelegate>