I have a real head-scratcher right now. So, an NSTimer
object, an NSMethodSignature
object, and an NSInvocation
object walk into a bar. Here's the rest of the joke:
NSMethodSignature *methodSig = [NSMethodSignature methodSignatureForSelector:@selector(setAlphaValue:)];
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:methodSig];
CGFloat alphaVal = 1.f;
[inv setSelector:@selector(setAlphaValue:)];
[inv setTarget:tabViewItem.view];
[inv setArgument:&alphaVal atIndex:2];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.5f invocation:inv repeats:NO];
Here's what I'm getting in the debugging console:
+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil
Edit: I'm not sure why someone thought it was necessary to down-vote my question. Sorry for trying to learn something new. Actually, here's an amendment to my original question: what should I have done differently? Should I have just deleted the post once I figured out what my problem was? I tried to follow all of the Stack Overflow etiquette, and I even took the time to leave an answer in the off chance it could help someone else. Next time, should I just return to my question and leave a response like, "nvm … figured it out. thx?" Or should I just leave it here, unanswered? I sure as hell know I'm tired of clicking on links only to be led to unanswered posts.