gpt4 book ai didi

ios - Xcode4.3 UIActionSheet 导致错误信息

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:30:37 25 4
gpt4 key购买 nike

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

Sending 'ViewController *const __strong' to parameter of incompatible type '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];
}

最佳答案

这很完美!

// Make Class conform to UIActionSheet delegate
@interface ViewController : UIViewController<MFMailComposeViewControllerDelegate,UIActionSheetDelegate>

关于ios - Xcode4.3 UIActionSheet 导致错误信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15705723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com