Re: Load/Save buttons
Re: Load/Save buttons
- Subject: Re: Load/Save buttons
- From: Graham Cox <email@hidden>
- Date: Sat, 4 Oct 2008 20:50:16 +1000
On 4 Oct 2008, at 6:48 am, email@hidden wrote:
I am trying to create an application that will load an XML file into
an
array when you press the load button, and save when you press a save
button. However, I don't see any examples online or in my books that
suggest how to handle dataOfType or readFromData on a button click.
Well, why would you expect to, really? Books can't be expected to
cover every possible way to configure an app, especially if it's a bit
non-standard, as here.
You could declare action methods in your controller to respond to the
buttons, then call the relevant methods from there. Or hook the
buttons to the action methods that the usual Save and Open menu items
are connected to (you can find out what these are by exploring the
standard items in IB).
On a general note, sample code/how-tos and documentation can only go
so far in teaching you how to do stuff. At some point, you are
expected to "get it" and synthesise new solutions for your specific
situation yourself. That's true of everything you've ever learned, not
just programming.
cheers, Graham
_______________________________________________
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