質問

To force change device orientation, I take code from here

but can apple reject app that use setOrientation: ? have some one experience?

or may be someone have 100% work and not can be rejected by Apple, solution?

if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) {
        if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
            int orientationPortrait = UIInterfaceOrientationPortrait;
            NSMethodSignature *sig = [[UIDevice currentDevice] methodSignatureForSelector:@selector(setOrientation:)];
            NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig];
            [invo setTarget:[UIDevice currentDevice]];
            [invo setSelector:@selector(setOrientation:)];
            [invo setArgument:&orientationPortrait atIndex:2];
            [invo invoke];
        }
    }

Ok, thanks, I will try with this snippet.

役に立ちましたか?

解決

NO, Apple will reject on the basis of force orientation. Some times it is requirement and only way to view in landscape/portrait. Apple will not REJECT .

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top