/ /私のコードの何が問題になっていますか? (UIActionSheet)[終了]-ios、objective-c、cocoa-touch

私のコードで何が間違っていますか? (UIActionSheet)[閉じる] - ios、objective-c、cocoa-touch

UIActionSheetを作成するこのコードの何が問題になっていますか? delegate:selfについて不平を言っていますが、その理由はわかりません。 これが私のコードです:

-(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];
}

回答:

回答№1は2

クラスをそのプロトコルに準拠させる:

@interface MyClass : NSObject <UIActionSheetDelegate>