In the interface for my AppDelegate I have the following property declaration:
@property (strong) NSArray *fileNamesInCurrentDirectory;
and then, in the implementation:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self setFileNamesInCurrentDirectory:[NSArray arrayWithObject:@"hello"]];
}
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
return [self.fileNamesInCurrentDirectory count];
}
When numberOfRowsInTableView is called, fileNamesInCurrentDirectory is nil. Why?
Thanks in advance.
Because as mentioned in the documentation
Which means, I guess, that the application loads entirely, build all views and then call the method.
Is there any reason why you need your method call to occur after the application is loaded ?