I want to set an NSString property of a main view from a nested view. I do so right now by allocating the previous class and accessing the class.property. When I pop the view controller programmatically and NSLog the property from the main view, it’s null.
How does this happen?
EDIT:
MainViewController *controller = [[MainViewController alloc] init];
switch (indexPath.row) {
case 0:
controller.category = @"Categorie 1";
break;
default:
break;
}
[controller release];
You mentioned you are going to pop the viewController so I assume you are trying to set a property of the controller below the navigation stack.
Instead of creating a new object of the class, you should get back the original object that was already created.