Members heroes, ask a question:
I need to forcibly rotated in the code to a specific direction
not be used directly after ios5 setOrientation method, find the online postings can say the following code
if ([[UIDevice currentDevice] respondsToSelector: @ selector (setOrientation :)]) {
[[UIDevice currentDevice] performSelector: @ selector (setOrientation :)
withObject: (id) UIInterfaceOrientationLandscapeRight];
}
Due to the use of the ARC, the system will prompt
Cast of 'int' to 'id' is disallowed with ARC
Tried some qualifiers are still not, please heroes
Reply:
The arc set no
Reply:
buildseting - Search auto then object-c + + auto ... set no
Reply:
Set no words need to manually manage the memory of it, so a lot of trouble to write code Oh, ios5 they should still have a way to deal directly with it, thank you!
Reply:
Top, expert guidance!
Reply:
Their top, expert advice, thank you!
Reply:
This is what you look at the file, you can set a file NA ARC's.
The compile sources in the target, and the file specified as-fno-objc-arc
On it
Reply:
Hello, is there no way in the case of arc above the function call it?
Reply:
Or cocoachina the master more, and finally resolved, Tieshanglai make a mark, a Marshal solve
maxwin called
if ([[UIDevice currentDevice] respondsToSelector: @ selector (setOrientation :)]) {
SEL selector = NSSelectorFromString (@ "setOrientation:");
NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: [UIDevice instanceMethodSignatureForSelector: selector]];
[Invocation setSelector: selector];
[Invocation setTarget: [UIDevice currentDevice]];
int val = UIInterfaceOrientationLandscapeRight;
[Invocation setArgument: & val atIndex: 2];
[Invocation invoke];
}
No comments:
Post a Comment