I have a NSString that is taken from a UITextField in a ViewController. Every of my other ViewController will use this NSString as well. How can I pass this NSString to others ViewControllers?
See Question&Answers more detail:osI have a NSString that is taken from a UITextField in a ViewController. Every of my other ViewController will use this NSString as well. How can I pass this NSString to others ViewControllers?
See Question&Answers more detail:osYou want to have a property in each of your controllers
@interface MyViewController : UIViewController{
NSString *title;
}
@property (retain) NSString *title;
@end;
@implementation MyViewController
@synthesize title;
@end;
Use it like:
MyViewController *myVC = [[MyViewController alloc] initWithFrame:...];
myVC.title = @"hello world";
You should be familiar with Memory Management