2012-01-31 72 views
0

我正在嘗試創建一個應用程序,該應用程序會創建一個隨機圖像按鈕,並且代碼有效。當我的應用程序生成一個圖像,我想創建一個按鈕,我可以發送一封電子郵件,附帶的屏幕截圖...我知道這兩個行爲的代碼,但是當我把它們放在控制器h和m中時,有很多錯誤...請幫助我!Xcode隨機圖像按鈕和電子郵件按鈕

@interface __3_ProductionsViewController : UIViewController 

<MFMailComposeViewControllerDelegate> 

-(IBAction)openMail:(id)sender; 
-(IBAction)randomimagebutton; 

{ 


    IBOutlet UIImageView *imageview; 

} 


@end 
+0

你可以發佈你所得到的錯誤的連接 – MobileOverlord 2012-01-31 13:06:15

回答

0

根據您得到的錯誤,您可能需要重新排列格式。這是我如何宣佈h和m。

// __3_ProductionsViewController.h 

#import <MessageUI/MessageUI.h> 
#import <MessageUI/MFMailComposeViewController.h> 
@interface __3_ProductionsViewController : UIViewController 
<MFMailComposeViewControllerDelegate> 

@property (nonatomic, retain) IBOutlet UIImageView *imageview; 
-(IBAction)openMail:(id)sender; 
-(IBAction)randomimagebutton:(id)sender; 

@end 

// __3_ProductionsViewController.m 

#import "__3_ProductionsViewController.h" 
@implementation UpdateViewController 
@synthesize imageView; 

-(IBAction)openMail:(id)sender { 

} 
-(IBAction)randomimagebutton:(id)sender { 

} 
@end 

你需要使用界面生成器連接IBActions以及拖動到你imageView