Re: CD: Creating a managed object
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