That could be an answer : Work with a singleton and use your model in your ViewController
and your UITableViewController
in the .h
:
+(MyModel *)shared;
in the .m
:
static MyModel *myModel;
@implementation MyModel
+(MyModel *) shared{
if (nil != myModel) {
return myModel;
}
static dispatch_once_t pred;
dispatch_once(&pred, ^{
myModel = [[MyModel alloc] init];
});
return myModel;
}
In this way, you can access to your model anywhere of your app.
Hope that will help.