Re: string convertion: converting getter name to setter

2008-09-05 Thread steph thirion
On Sep 5, 2008, at 5:36 PM, Sherm Pendley wrote: And, the conceptual docs devote an entire page to detailing how scalar and structure variables are supported, including specifically what types are supported, and what object classes are used to "wrap" them:

Re: string convertion: converting getter name to setter

2008-09-05 Thread Sherm Pendley
On Fri, Sep 5, 2008 at 11:20 AM, steph thirion <[EMAIL PROTECTED]> wrote: > > By the way, I don't have much experience with profiling, I've only used > Instruments a bit to check for leaks. Is Shark better than instruments for > this type of optimizations? I haven't used Instruments, just Shark.

Re: string convertion: converting getter name to setter

2008-09-05 Thread steph thirion
On Sep 5, 2008, at 7:42 AM, Sherm Pendley wrote: Frankly, this smells a *lot* like premature optimization. Do you have any evidence that the simple solution doesn't perform acceptably? That is, have you written your code the easy way first, and profiled it with Shark? you're right. I'

Re: string convertion: converting getter name to setter

2008-09-04 Thread Sherm Pendley
On Thu, Sep 4, 2008 at 10:51 PM, steph thirion <[EMAIL PROTECTED]> wrote: > > Same with NSInvocation, AFAIK you can only pass objects. > Where'd you get that idea? NSInvocation's -setArgument:atIndex: method takes a void* for its first argument, and describes it as "an untyped buffer." If only ob

Re: string convertion: converting getter name to setter

2008-09-04 Thread Charles Steinman
--- On Thu, 9/4/08, steph thirion <[EMAIL PROTECTED]> wrote: > I'm working on a class that will manage transitions of > properties. > It's for a game on a slower device, so I need the less > costly solution. I can understand your performance constraints, but have you actually profiled your gam

Re: string convertion: converting getter name to setter

2008-09-04 Thread Phil
On Fri, Sep 5, 2008 at 2:51 PM, steph thirion <[EMAIL PROTECTED]> wrote: > I was trying to go with performSelector, but just a while ago I was stunned > to find out there's no way to pass along an argument that is a basic type. > Same with NSInvocation, AFAIK you can only pass objects. And I'd rath

Re: string convertion: converting getter name to setter

2008-09-04 Thread steph thirion
On Sep 5, 2008, at 3:34 AM, Phil wrote: I assume you want to do more with the selector than just invoke it---otherwise you can just use KVC and save yourself some grief. Actually, that's all I want! I'm working on a class that will manage transitions of properties. It's for a game on a sl

Re: string convertion: converting getter name to setter

2008-09-04 Thread Phil
On Fri, Sep 5, 2008 at 1:53 PM, Steve Weller <[EMAIL PROTECTED]> wrote: > > From memory I think that does not work: capitalizedString also decapitalizes > all but the first character, so capitalizedString will become > setCapitalizedstring instead of setCapitalizedString. > Gah, you're right! I gu

Re: string convertion: converting getter name to setter

2008-09-04 Thread Steve Weller
On Sep 4, 2008, at 6:37 PM, Phil wrote: On Fri, Sep 5, 2008 at 1:27 PM, Andrew Merenbach <[EMAIL PROTECTED]> wrote: SEL getterSel = @selector(balloonColor); NSString *getterName = NSStringFromSelector(getterSel); NSString *setterName = [@"set" stringByAppendingString:getterName]; SEL setterSel

Re: string convertion: converting getter name to setter

2008-09-04 Thread Andrew Merenbach
On Sep 4, 2008, at 6:37 PM, Phil wrote: On Fri, Sep 5, 2008 at 1:27 PM, Andrew Merenbach <[EMAIL PROTECTED]> wrote: SEL getterSel = @selector(balloonColor); NSString *getterName = NSStringFromSelector(getterSel); NSString *setterName = [@"set" stringByAppendingString:getterName]; SEL setterSel

Re: string convertion: converting getter name to setter

2008-09-04 Thread Phil
On Fri, Sep 5, 2008 at 1:27 PM, Andrew Merenbach <[EMAIL PROTECTED]> wrote: >> SEL getterSel = @selector(balloonColor); >> NSString *getterName = NSStringFromSelector(getterSel); >> NSString *setterName = [@"set" stringByAppendingString:getterName]; >> SEL setterSel = NSSelectorFromString(setterNam

Re: string convertion: converting getter name to setter

2008-09-04 Thread Phil
On Fri, Sep 5, 2008 at 12:40 PM, steph thirion <[EMAIL PROTECTED]> wrote: > > from the selector of a given getter function, I need to get the selector of > the equivalent setter function. For instance, from color I should get > setColor. > I assume you want to do more with the selector than just i

Re: string convertion: converting getter name to setter

2008-09-04 Thread Andrew Merenbach
On Sep 4, 2008, at 5:40 PM, steph thirion wrote: from the selector of a given getter function, I need to get the selector of the equivalent setter function. For instance, from color I should get setColor. char* getterName = sel_getName(getterSelector); char * setterName = ... ? ... SEL