use*_*531 2 xcode uiactionsheet ios
该应用程序在测试时工作得非常好,但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
Run Code Online (Sandbox Code Playgroud)
在我的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];
}
Run Code Online (Sandbox Code Playgroud)
这完美!
// Make Class conform to UIActionSheet delegate
@interface ViewController : UIViewController<MFMailComposeViewControllerDelegate,UIActionSheetDelegate>
Run Code Online (Sandbox Code Playgroud)