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: steph thirion <email@hidden>
- Date: Fri, 5 Sep 2008 17:20:13 +0200
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'm taking too many assumptions. And seeing that KVC and
NSNumber doesn't seem like a problem around here is encouraging, I
needed that to start questioning my unfounded preconceptions.
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?
On Sep 5, 2008, at 6:25 AM, Phil wrote:
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.
I just pull it off using KVC. The problem I was having yesterday was
that I didn't know valueForKey: returned an object (NSCFNumber). There
is no mention of that on the method documentation..
Basically what I did is an animation class, that manages an array of
running transitions. To create a transition, I send it a target
object, a property key, an end value, a duration, and a type of
easing. On init, the current value of the property is saved with
valueForKey, and on every frame, the current value is set with
setValue:forKey:. When the duration ends, the transition object is
removed from the array.
_______________________________________________
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