domhofmann / PRTween

Lightweight tween library for iOS
BSD 2-Clause "Simplified" License
459 stars 63 forks source link

Not assigning given target in some helper methods. #14

Closed rbrisita closed 12 years ago

rbrisita commented 12 years ago

In the methods of tween:(id) object, tween:(CGFloat *)ref, and lerp:(id)object in PRTween the given target is never assigned so the given completeSelector is never executed.

domhofmann commented 12 years ago

Hmm... not sure about this one. Are you assigning it to the object that is being tweened (and did you expect it to do that?) I can think of some cases where the user would want to assign this to a different target. I guess in this case, the intent is that the user would specify the target after creating the tween. Let me know your thinking.

rbrisita commented 12 years ago

True, that a developer would want to assign a target after creating the tween but if we look at lines 211-226, 228-241, and 251-266 of PRTween the methods' themselves contain a parameter of target but it is never assigned.

domhofmann commented 12 years ago

Doing some thinking about the best way to handle this. Two approaches:

1) Set the default target to the object being tweened 2) Expose target in the selector

Any preference?

rbrisita commented 12 years ago

I think we have to clarify the word "target" here. By "target" I mean the delegate to which the completeSelector belongs to. As of now the completeSelector will never execute when the operation expires because its target (delegate) is NULL.

The only addition for it to work in the methods I mentioned would be:

operation.target = target; //< This is currently not present in your branch
operation.completeSelector = selector;
domhofmann commented 12 years ago

D'oh, option 2 is already occurring, I just misread (and subsequently misremembered) this last night. Fixing this now.