Re: NSTableView questions
Re: NSTableView questions
- Subject: Re: NSTableView questions
- From: "I. Savant" <email@hidden>
- Date: Tue, 25 Sep 2007 13:49:28 -0400
> set up the data source array in the initialization of your controlling
> object. so if you have AppController with an NSMutableArray property you
> would setup initialize / setup the data source array in AppControllers
> init. i guess this assumes you have AppController instantiated in your nib
> file
-init is probably not where you'd want to load data from a file and
force an update when the application finishes launching.
1 - What if you want to throw a dialogue if there's a problem with the file?
2 - What if the rest of the UI in the nib is not finished loading
when you ask it to update?
3 - What if other startup logic requires that the data is loaded in
order to succeed?
Consider using the -applicationDidFinishLaunching: delegate method
(easily found by searching the documentation for "application launch",
two words the OP used in his question). When this is called, you can
rest assured that your application is ... well ... finished launching
and that all the required parts are fully assembled and ready to go.
From there you can (while checking for errors and handling them
appropriately) try to load the file, then trigger any dependent UI
updates. You can also make sure that, upon fatal error, you have the
chance to notify the user and terminate before anything else can be
done. All this is contained in one neat, easily-managed location.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden