hi i am new to iphone development.
I'm trying with sample where I need to copy a string from the textfield of viewController and display it on the next view with a Label.
On the first view there is button bellow the textfield.1
I am not able to fix some issues showing BAD ACESS can anyone help me in solving this.
Let me know what i'm doing Wrong.
Thank you.
//copystring.h
@interface CopystringViewController : UIViewController{
UITextField *myTextField;
NSString *somestring;
}
@property(nonatomic,retain)IBOutlet UITextField *myTextfield;
@property(nonatomic,retain)NSString *somestring;
-(IBAction)next:(id)sender;
//.m file
@synthesize myTextfield,somestring;
-(IBAction)next:(id)sender;
{
NextView * next = [[NextView alloc] initWithNewString: myTextField.text];
[self.navigationController presentModalViewController: next animated: YES];
}
NextView.h
@interface NextView : UIViewController{
UILabel *string2;
}
@property(nonatomic,retain)IBOutlet UILabel *string2;
- (id)initWithNewString:(NSString*)someString;
//.m file
@synthesize string2;
-(id)initWithNewString:(NSString*)someString {
string2 = someString;
return self;
}