Last active
August 29, 2015 14:13
-
-
Save majie1993/6646ff67ca53d671d618 to your computer and use it in GitHub Desktop.
Performselector has non objective-c object
From http://stackoverflow.com/questions/904515/how-to-use-performselectorwithobjectafterdelay-with-primitive-types-in-cocoa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SEL theSelector = NSSelectorFromString(@"setOrientation:animated:"); | |
NSInvocation *anInvocation = [NSInvocation | |
invocationWithMethodSignature: | |
[MPMoviePlayerController instanceMethodSignatureForSelector:theSelector]]; | |
[anInvocation setSelector:theSelector]; | |
[anInvocation setTarget:theMovie]; | |
UIInterfaceOrientation val = UIInterfaceOrientationPortrait; | |
BOOL anim = NO; | |
[anInvocation setArgument:&val atIndex:2]; | |
[anInvocation setArgument:&anim atIndex:3]; | |
[anInvocation performSelector:@selector(invoke) withObject:nil afterDelay:1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment