Re: NSDocument and KVO compliance
Re: NSDocument and KVO compliance
- Subject: Re: NSDocument and KVO compliance
- From: Kevin Perry <email@hidden>
- Date: Fri, 18 Oct 2013 12:13:56 -0700
If you wanted to try this, you should also override -updateChangeCountWithToken:forSaveOperation:, which is used to decrement change counts after saving.
I expect this would get you 99% of the way, but as Seth said, don't expect it to be bulletproof.
On Oct 18, 2013, at 11:49 AM, Seth Willits <email@hidden> wrote:
> On Oct 18, 2013, at 11:41 AM, email@hidden wrote:
>
>> Twice recently I have found myself tinkering with NSDocument et al to support observing of certain values.
>> For example, NSDocument -isDocumentEdited is not seemingly KVO compliant.
>> -isDocumentEdited status is driven by -updateChangeCount: so
>>
>> ...
>>
>> Is this the best way to go about addressing these sorts of issues with regard to missing KVO compliance?
>
> Well, the best thing to do is file a radar and wait a couple years for them to get around to adding it. :(
>
> That said, it would probably mostly work, but it's not always guaranteed to be bulletproof because those keys could also be influenced by private methods.
>
>
> --
> Seth Willits
>
>
>
>
> _______________________________________________
>
> 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
_______________________________________________
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