Re: string convertion: converting getter name to setter
Re: string convertion: converting getter name to setter
- Subject: Re: string convertion: converting getter name to setter
- From: "Sherm Pendley" <email@hidden>
- Date: Fri, 5 Sep 2008 01:42:04 -0400
On Thu, Sep 4, 2008 at 10:51 PM, steph thirion <email@hidden> 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 objects could be passed, the first argument would be declared as id*.
Also, its description says "This method copies the contents of *buffer* as
the argument at *index*. The number of bytes copied is determined by the
argument size." There would be no need to determine their size, since
objects are pointers and pointers are all the same size.
The only documented limitation with respect to argument types is that it
can't handle variadic argument lists, or union types.
> 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.
>
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?
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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