Re: Strange NSManagedObjectContextObjectsDidChangeNotification behavior
Re: Strange NSManagedObjectContextObjectsDidChangeNotification behavior
- Subject: Re: Strange NSManagedObjectContextObjectsDidChangeNotification behavior
- From: Jerry Krinock <email@hidden>
- Date: Wed, 25 Feb 2009 08:30:42 -0800
On 2009 Feb 25, at 06:55, Karolis Ramanauskas wrote:
Lesson: Don't change model data in a -draw method. I really can't
think of any reason why you'd want to do this. -draw is for
drawing.
Yes, perhaps, but I have to change it, perhaps not in a draw method
itself, but in another method that get's called before it.
... [input setLocationX: ([self locationX] + ...
Any suggestions?
Is locationY the model attribute which you "have to" change? If so, I
suggest that this is not rightfully a model or managed object
attribute. Obviously, it's more of a 'view' thing than a 'model'
thing. Remove it from your data model. Make it a regular instance
variable instead or, better yet, remove it entirely from your model
class and calculate it in your view class when you need to draw.
Thousands of apps do it that way -- it will work for your app too!
_______________________________________________
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