Hi all, I've been banging my head with this one this evening and am sure it's something very simple that I've missed
I've created a new project with the appdelegate and a view controller class as below. The view controller synthesises the property in the .m, and the app delegate header imports the view controller .h file. Code below:
View controller header:
@interface untitled : UIViewController {
NSString *string;
}
@property (nonatomic, retain) NSString *string;
App delegate:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
testViewController = [[untitled alloc] initWithNibName:@"untitled" bundle:nil];
testViewController.string = @"Testing String";
[window addSubview:testViewController.view];
[window makeKeyAndVisible];
}
Can someone please help and point out the obvious mistake as to why setting the string property fails here with the error mentioned? Is it because of being inside this method? I've never had issues setting properties in other methods before after initing a view controller.
Thanks.