我已经建立了一个目录。有133人。我有三个标签。“姓名”、“职位”和“电子邮件”。我如何使电子邮件标签充当按钮以打开带有标签地址的空白电子邮件?我遇到的问题是标签是动态的,我无法设置它。我是初学者,所以任何帮助将不胜感激!
这是.h文件-
@interface PersonDetailControllerViewController : UIViewController
@property(weak) IBOutlet UILabel *name;
@property(weak) IBOutlet UILabel *position;
@property(weak) IBOutlet UILabel *email;
@property(strong) Person *person;
@end
这是 .m 文件-
#import "PersonDetailControllerViewController.h"
@interface PersonDetailControllerViewController ()
@end
@implementation PersonDetailControllerViewController
@synthesize name, position, email, person;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.name.text = self.person.name;
self.position.text = self.person.position;
self.email.text = self.person.email;
// Do any additional setup after loading the view.
}
@end