I\'m using Xcode 4.5 with ARC to create a UITableViewController class and I want to initialize it with a NSDictionary. In its initializer the created [resourcesAsDictionary coun
I would change this in a couple of ways...
Remove the iVar for resourcesAsDictionary and set it as a property instead.
@property (nonatomic, strong) NSDictionary *resourcesAsDictionary;
Then I'd change the initialisation by removing your init method and using this property instead.
In the viewController that pushes on to this controller (i.e. where you call the initWithDictionary)...
Instead of initWithDictionary have...
ResourcesTableViewController *tvc = [[ResourcesTableViewController alloc] initWithStyle:];
Then set the property...
tvc.resourcesAsDictionary = mySourceDictionary;
Then push the TVC...
[self.navigationController pushViewController:tic animated:YES];
...or however you are pushing this to the screen.
Finally you'll need to change your numberOfRows... code to...
return [self.resourcesAsDictionary count];
The would be my approach and it means you don't have to override the init of the UITableViewController class.
By having the strong property you are ensuring it will stay around for the life of the owning object. And by not overriding the init you ensure that you're not missing out on any code that gets called in initWithStyle...
If this doesn't work then I can only think that there is something not right with the way you are creating the dictionary in the first place.
In the - (void)viewWillAppear... function tell me the output of...
NSLog(@"%@", self.resourcesAsDictionary);