I have two classes named InterfaceController
and LoadInterfaceController
.
I'm fetching information in the LoadInterfaceController
that I wish to pass-on to a variable
in my InterfaceController
class.
LoadInterfaceController
:
- (void)fetchData {
NSArray *database = //fetched information
//... on fetch complete
InterfaceController *interfaceController = [InterfaceController alloc];
[interfaceController initilizeDatabase:database];
}
InterfaceController
:
@property (nonatomic) NSArray *db;
- (void)initilizeDatabase:(NSArray *)database {
self.db = database;
NSLog(@"database count: %d", database.count); //: 3
NSLog(@"db count: %d", self.db.count); //: 3
[self utilizeInformation];
}
- (void)utilizeInformation {
NSLog(@"db count: %d", self.db.count); //: 0
//...
}
db
's information is not retained outside of the initilizeDatabase:
function.
I have tried running it on the main thread
(as explained here), but the information is still not retained. How may I specify the thread to pass-on the information from my second class?