On 10 May '08, at 6:53 PM, Chris Hanson wrote:

Not necessarily. You can simply return a constant YES for a read- only "dirty" property, and treat the property-change itself as the trigger you care about.

A "dirty" property that tells lies half the time doesn't sound like a good idea to me... o_O

If listening for a property change is the only way to tell if an object's dirty, that means that only objects that have been around as long as the target object, and registered as listeners when the target was first created, can reliably tell if it's dirty. (And they'd have to implement their own flag to remember this state, if they didn't want to act on it immediately...)

Worse, KVO sends out a lot of false-alarm property change notifications. Calling -setUUID: and passing in the original UUID (or an equal string) will trigger a notification, even though the property value hasn't changed. You really don't want that to mark the object as dirty, if that results in as much work as an UPDATE to a database row.

—Jens

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

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to