2012-01-31 37 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