Hi all,

I have a situation where I need to build a new selector name from an existing one, by prepending a new part to the selector. e.g. if I have an object with a property 'fooBar', I want to generate the selector 'setSomeSpecialPrefixFooBar'

The problem I've run into is preserving the camel case of the original selector element correctly, so that 'fooBar' becomes 'FooBar', not 'Foobar' as it becomes when applying -capitalizedString to it.

I think just making the first character uppercase would be sufficient, but I'm not sure how to do that reliably with the unichar data type, so that's my first question. The second is that when generating selectors programmatically like this, are there other pitfalls to consider so that the resulting selector is always predictable? The scheme needs to work with arbitrary properties, just as various parts of KVC and KVO do.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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