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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to