Re: NSString category name collision?
Re: NSString category name collision?
- Subject: Re: NSString category name collision?
- From: "email@hidden" <email@hidden>
- Date: Tue, 26 Jan 2010 17:58:23 +0000
On 26 Jan 2010, at 17:28, Jens Alfke wrote:
>
> On Jan 26, 2010, at 8:08 AM, email@hidden wrote:
>
>> Is this just one of the things we have to put up with as the price for dynamism or can this problem be pre-empted?
>> I added a name space prefix to my method definition and the exception departed.
>
> Yes. To avoid these kinds of collisions, if you add a category method to an external class you should add some sort of hopefully-unique prefix to its name. In my Mooseyard software I use the same prefix I use for my class names ("MY") only lowercased, with an underscore — e.g. -[NSString my_rot13].
>
Thanks Jens.
That's a point of good practice that I don't currently follow. Once bitten etc.
Jonathan
_______________________________________________
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