My personal preference is the separation of code execution from interface objects.
For example, say I have a Soda class. The Soda class has properties such as weight, height, and a brand name.
Say I also have another class called “Brain”.
I want Brain to populate an NSTable with Soda objects, yet I only want my AppDelegate class to declare the interface objects.
AppDelegate.h
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSTableView * sodaTable;
@end
Brain.m
@implementation Brain : NSObject
- (void)aquireCaffine
{
/* Do stuff here that populates the sodaTable */
}
Any form of separation will do.
I also mean to say that I don’t want appDelegate to handle the call.
This means that I’d rather not do the following to AppDelegate.h:
[self aquireCaffineUsingTable:sodaTable];
Perhaps I’m doing something extremely not Objective-C oriented, but I have my preferences do I not?
You can have your app delegate only declare interface objects. At some point, you’ll need to set the table’s data source to an object which implements the table data source protocol (NSTableViewDataSource). That object fills out the table whenever the table’s -reloadData method is called. You can set the table’s data source in code or in Interface Builder. See the docs for more info.