On Apr 10, 2012, at 1:49 PM, Rick Mann wrote:

> Are there functions provided in the Objective-C runtime to convert property 
> names? For example, say I have a key name like "fooKey", and I want to get 
> "FooKey", or the setter name "setFooKey" from it. I could do the name munging 
> myself, but I wonder if there aren't edge cases. For example, "setURL" should 
> covert to "URL", not "uRL".
> 
> In my particular case, I'm trying to implement functionality like 
> +keyPathsForValuesAffecting<Key>. It takes a key name (usually something that 
> starts with a lower-case letter) and changes it to start with an upper-case 
> letter, then appends it to "keyPathsForValuesAffecting" to create the 
> selector name.
> 
> Are those conversion methods provided anywhere? I looked through the Obj-C 
> runtime and didn't see anything, but I didn't read every single page.
> 

I've used keyPathsForValues.. and my own variants extensively and I've never 
needed to know the setFoo version of my key names. What are you doing that 
depends on setter names? Maybe there's a better way.
_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to