I don't understand this:
+ (void)beginAnimations:(NSString *)animationID context:(void *)context
(void *) ----> what kind of data can I provide here?
I don't understand this:
+ (void)beginAnimations:(NSString *)animationID context:(void *)context
(void *) ----> what kind of data can I provide here?
Pass anything you want; void *
means it's a buffer without a type, so the system ignores its contents.
Next time a Google search for "void *" might help you figure out what it means—I'm assuming you just didn't understand why it was ignored by the system (it's just for your convenience).
Use it to pass a pointer to the object that you're animating. When you call setAnimationDidStopSelector
you have to give it a method selector to call. That method's signature has to be of the form:
- (void)animationDidStop:(NSString *)animationID
finished:(NSNumber *)finished
context:(void *)context
The context value you defined in beginAnimations
is passed untouched to this method. It's just a (void *) which is shorthand for "a pointer to anything you want it to be." An object, an integer, a struct. Whatever.
Instead of "context" think of it as "userData."