• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Where To Put Export... In Document-Based Core Data App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where To Put Export... In Document-Based Core Data App


  • Subject: Re: Where To Put Export... In Document-Based Core Data App
  • From: Graham Cox <email@hidden>
  • Date: Mon, 15 Feb 2010 16:20:06 +1100

On 15/02/2010, at 5:23 AM, steve ross wrote:

> Questions:
>
> - Is the document class the right place? It makes sense to me that the document would know how to save itself

Yes it is.


> - Would the controller, instead, want to tell the document to persist itself as CSV?

You might want some other object within the data model to return the CSV data for saving, but it seems reasonable to me that the document itself does the saving.


> - How can I hook a File > Export... menu item to a controller action. I can hook it to AppController and then send a message but it seems hacky.


Set the menu's target to First Responder. The document will get it. You may want to also have your document support the -validateMenuItem: method to make the command available when appropriate.


> - [OT] This targets Snowy only. Do I really need to use release and autorelease if I turn on GC mandatory?

No, these are no-ops with GC. BUT if there's any chance at all that you'd want to port the code back to < 10.6, you'll be very sorry if you don't put them in now.

--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

References: 
 >Where To Put Export... In Document-Based Core Data App (From: steve ross <email@hidden>)

  • Prev by Date: Re: Where To Put Export... In Document-Based Core Data App
  • Next by Date: Question about zipping files
  • Previous by thread: Re: Where To Put Export... In Document-Based Core Data App
  • Next by thread: Question about zipping files
  • Index(es):
    • Date
    • Thread