2

该应用程序在测试时运行良好,但在delegate:self我旁边...

将“ViewController *const __strong”发送到不兼容类型“id<UIActionSheetDelegate>”的参数

非常感谢您对此的任何帮助,因为我已经为此工作了好几天!

我的 Viewcontroller.h 是...

#import <UIKit/UIKit.h>
#import <Social/Social.h>

#import "Accounts/Accounts.h"
#import <MessageUI/MessageUI.h>


@interface ViewController : UIViewController<MFMailComposeViewControllerDelegate>

{
    UIAlertView *objresponseAlert;
}
@property (weak, nonatomic) IBOutlet UITextView *myTextView;

- (IBAction)emailButton:(id)sender;
@end

在我的 ViewController.m 我有....

- (IBAction)emailButton:(id)sender {    
    UIActionSheet *actionsheet = [[UIActionSheet alloc]
                                  initWithTitle:@"Title"
                                  delegate:self
                                  cancelButtonTitle:@"Cancel"
                                  destructiveButtonTitle:nil
                                  otherButtonTitles:@"Email", nil];
    [actionsheet showInView:self.view];
}
4

1 回答 1

5

这很完美!

// Make Class conform to UIActionSheet delegate
@interface ViewController : UIViewController<MFMailComposeViewControllerDelegate,UIActionSheetDelegate>
于 2013-10-04T14:41:05.043 回答