• 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: CD: Creating a managed object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CD: Creating a managed object


  • Subject: Re: CD: Creating a managed object
  • From: "Marcus S. Zarra" <email@hidden>
  • Date: Mon, 28 May 2007 23:00:11 -0600

A suggestion then would be to write this mouseDown: call so that it sends a message to the view's delegate. This would then pass control back over to the controller when the mouse down is detected and preserve the MVC.

Marcus S. Zarra
Zarra Studios LLC
Simply Elegant Software for OS X
www.zarrastudios.com

On May 28, 2007, at 9:42 PM, Ian Joyner wrote:

OK, even if this is not quite right, it's only a small routine to refactor, so I think this is pretty clean (the only thing I'm uneasy about is manipulating a model object in a view, but perhaps that is alright.

IBOutlet NSArrayController *nsa;

...

-(void) mouseDown: (NSEvent *)event {
   NSPoint p = [event locationInWindow];
   NSManagedObject *mo = [nsa newObject];
   [mo setValue: [NSNumber numberWithFloat: p.x] forKey: @"x"];
   [mo setValue: [NSNumber numberWithFloat: p.y] forKey: @"y"];
}


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >CD: Creating a managed object (From: Ian Joyner <email@hidden>)
 >Re: CD: Creating a managed object (From: mmalc Crawford <email@hidden>)
 >Re: CD: Creating a managed object (From: Ian Joyner <email@hidden>)
 >Re: CD: Creating a managed object (From: mmalc Crawford <email@hidden>)
 >Re: CD: Creating a managed object (From: Ian Joyner <email@hidden>)

  • Prev by Date: Re: observing dealloc
  • Next by Date: Re: observing dealloc
  • Previous by thread: Re: CD: Creating a managed object
  • Next by thread: Re: CD: Creating a managed object
  • Index(es):
    • Date
    • Thread