Re: Calling processPendingChanges from awakeFromInsert
Re: Calling processPendingChanges from awakeFromInsert
- Subject: Re: Calling processPendingChanges from awakeFromInsert
- From: Jim Correia <email@hidden>
- Date: Thu, 20 Sep 2007 18:18:47 -0400
On Sep 20, 2007, at 6:09 PM, Mike Burns wrote:
If I don't disable undo registration when the user attempts to undo
after creating a new WBObject they undo the setting of the project
relationship first. (They have to undo twice to actually undo the
creation of the WBObject itself). I want the setting of the
initial values to be grouped with the creation of the WBObject as
far as the undo manager is concerned.
Absent any intervention on your part (via processPendingChanges) all
work which is done on one event loop cycle (in other words, as the
result of the user clicking on the "New WBObject" button) will be
grouped in on undo group.
My suggestion is to roll back your code to do the simplest thing
possible - just set the values in awakeFromInsert directly; no
delayed performs, etc. Then re-evaluate where you are and what
additional code is required.
It sounds like you have a very simple problem being made complex by
compounded hacks...
As for the second part of your response, there are certain values
that reside in the project object that need to be accessed by the
WBObject's at some point.
It sounds like the project is a document singleton/global. That the
objects need to access its properties still don't sound like a
compelling or correct reason to model a relationship between WBObject
and Project and pay the cost of maintaining those relationships and
their inverses. If this is the case, you should just fetch the
Project directly and use it when you need it. This has the side
effect that it also eliminates the problem you are having about (but
you should still understand why your code is wrong before you delete
it.)
Jim
_______________________________________________
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