0

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

1 に答える 1

2

クラスをそのプロトコルに準拠させます。

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