• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: string convertion: converting getter name to setter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string convertion: converting getter name to setter


  • Subject: Re: string convertion: converting getter name to setter
  • From: Phil <email@hidden>
  • Date: Fri, 5 Sep 2008 16:25:20 +1200

On Fri, Sep 5, 2008 at 2:51 PM, steph thirion <email@hidden> 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 rather
> avoid having NSNumber instances instead of simply int variables just because
> of that. Using an instance where I simply need an int or a float seems a
> waste of memory and performance, correct me if I'm wrong.
>

You can use +instanceMethodForSelector: to get a function that you can
use to call the method with primitive arguments---see the overview
section of the NSObject class reference.

> Then there's KVC. Which I haven't been able to pull out because of some int
> / id problems in arithmetics that I couldn't understand yet. But the concept
> of KVC seems like it could be costly, at least more than pointing directly
> to the right door, like performSelector or NSInvocation does.

However, finding the correct door is probably just as costly (or
potentially more than) KVC. I'd suggest avoiding developing your own
solution unless you know there's a problem with using what's provided
by the framework.

If you can tell us a bit more about what you're trying to accomplish,
we might be able to suggest some better approaches.

Phil
_______________________________________________

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

References: 
 >string convertion: converting getter name to setter (From: steph thirion <email@hidden>)
 >Re: string convertion: converting getter name to setter (From: Phil <email@hidden>)
 >Re: string convertion: converting getter name to setter (From: steph thirion <email@hidden>)

  • Prev by Date: Re: Accessing SDL Frameworks Bundled with Leopard...
  • Next by Date: Re: Why do all these methods of measuring string metrics with font attribute fail?
  • Previous by thread: Re: string convertion: converting getter name to setter
  • Next by thread: Re: string convertion: converting getter name to setter
  • Index(es):
    • Date
    • Thread