Register.h
@interface Register : NSObject {
NSString *_firstNameTxt;
NSString *_lastNameTxt;
NSString *_emailTxt;
NSString *_passwordTxt;
}
@property (nonatomic, retain) NSString * firstNameTxt;
@property (nonatomic, retain) NSString * lastNameTxt;
@property (nonatomic, retain) NSString * emailTxt;
@property (nonatomic, retain) NSString * passwordTxt;
@end
Register.m
@implementation Register
@synthesize firstNameTxt=_firstNameTxt;
@synthesize lastNameTxt =_lastNameTxt ;
@synthesize emailTxt=_emailTxt;
@synthesize passwordTxt= _passwordTxt;
- (void)dealloc{
[super dealloc];
[_firstNameTxt release];
[_lastNameTxt release];
[_emailTxt release];
[_passwordTxt release];
}
@end
RegisterViewController.h
@class Register;
@interface RegisterViewController : UIViewController {
Register *objRegister;
}
RegisterViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
objRegister = [[Register alloc] init];
}
テーブルビューデリゲート
[txtFirstName setText:objRegister.firstNameTxt];
[txtLastName setText:objRegister.lastNameTxt];
-(void) textFieldDidEndEditing:(UITextField *)textField{
// do the same code as Warren Burton Post
}