0

xcode 4.2でビデオプレーヤー、オーディオプレーヤーなどを含むiphoneアプリケーションを構築しています。基本的に問題は、電子メールの送信機能(フィードバック)です。私のコードはエラーなしで問題ありませんが、アプリを実行するとこれらの問題が発生し続け、ユーザーが電子メールを送信するために「フィードバック」ボタンをクリックするとクラッシュします。誰でも助けることができますか?

私が得るセマンティックな問題:

1) 警告: 互換性のない型 'FlipsideViewController *' [3] から 'id' に割り当てています:mailMe.mailComposeDelegate = self;

2) 警告: この行の不完全な実装 [-Wincomplete-implementation,3]:

@implementation FlipsideViewController

ここに私のflipsideview.hがあります:

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


@class FlipsideViewController;

@protocol FlipsideViewControllerDelegate
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller;
@end

@interface FlipsideViewController : UIViewController

@property (nonatomic, assign) IBOutlet id <FlipsideViewControllerDelegate,MFMailComposeViewControllerDelegate> delegate;

- (IBAction)done:(id)sender;
-(IBAction)website1:(id)sender;
-(IBAction)sentMail2:(id)sender;


@end

そして私のflipsideview.m(送信済みメールボタン)

-(IBAction)sentMail2 {
    MFMailComposeViewController *mailMe = [[MFMailComposeViewController alloc] init];
    mailMe.mailComposeDelegate = self;
    if ([MFMailComposeViewController canSendMail]) {
        [mailMe setToRecipients:[NSArray arrayWithObjects:@"my-email@e-mail.com",nil]];
        [mailMe setSubject:@"Feedback"];
        [mailMe setMessageBody:@"Name:(your name)., Please type your details correctly before sending the e-mail." isHTML:NO];
        [self presentModalViewController:mailMe animated:YES];
    }
    [mailMe release];

} - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    [self dismissModalViewControllerAnimated:YES];

    if (result == MFMailComposeResultSent) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message Sent!" message:@"Your message has been sent! \n Thank you for your feedback" delegate:self cancelButtonTitle:@"Okay!" otherButtonTitles:nil];
        [alert show];
        [alert release];
    } if (result == MFMailComposeResultFailed) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message Failed" message:@"Your email has failed to send \n Please try again" delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
        [alert show];
        [alert release];
    }
}
4

1 に答える 1

0

準拠するデリゲートマークが間違った場所にあります。スーパークラスを指定する@interfaceの部分の直後に配置します

于 2012-03-04T23:27:02.590 に答える