I have tried using the obvious method as outlined in the following example but my passed variable (rootcategory) is still nil on viewDidLoad in the loaded view.
This is my code:
CategoryViewController *viewController = [[CategoryViewController alloc] initWithNibName:@'CategoryViewController' bundle:[NSBundle mainBundle]]; self.categoryViewController.rootCategory = @'433'; self.categoryViewController = viewController; [viewController release];
I am synthesizing a property in the header as follows:
@property (nonatomic, readwrite) NSString *rootCategory;
You are allocating viewController, and try to change self.categoryViewController before it is assigned to viewController.
should work.