【问题标题】:Xcode Random Image Button, and email buttonXcode 随机图像按钮和电子邮件按钮
【发布时间】:2012-02-23 04:45:06
【问题描述】:
我正在尝试创建一个创建随机图像按钮的应用程序,并且代码有效。当我的应用程序生成图像时,我想创建一个按钮,我可以通过该按钮发送附有屏幕截图的电子邮件...我知道这两个操作的代码,但是当我将它们放入控制器 h 和 m 时,我有很多错误...请帮助我!
@interface __3_ProductionsViewController : UIViewController
<MFMailComposeViewControllerDelegate>
-(IBAction)openMail:(id)sender;
-(IBAction)randomimagebutton;
{
IBOutlet UIImageView *imageview;
}
@end
【问题讨论】:
标签:
xcode
image
button
random
mfmailcomposeviewcontroller
【解决方案1】:
根据您遇到的错误,您可能需要稍微重新排列格式。这就是我声明 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