Re: Stupid objective-c question
Re: Stupid objective-c question
- Subject: Re: Stupid objective-c question
- From: Graham Cox <email@hidden>
- Date: Sat, 24 Sep 2016 15:34:45 +1000
> On 24 Sep 2016, at 12:13 PM, Uli Kusterer <email@hidden> wrote:
>
>> I expect the first thing -isEqualToString: does is a pointer comparison, so it’s unlikely to be significantly less performant for the case of when the pointers are literally identical.
>
> No, Graham, don't do that!
>
> There is no guarantee that the context is a valid object. It is just supposed to be a unique pointer value so your class can tell a KVO notification from notifications for other observers on the same object (e.g. if a subclass observes the same value as a base class).
Yep, I’ve realised (from this discussion) that that’s an invalid assumption of another kind.
I’ve been revising code that does this as a result.
Always something to learn :)
—Graham
_______________________________________________
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