2011-06-12 18 views
13

Xcode में मैं FBConnect निम्नलिखित पंक्ति में एक चेतावनी मिलती है:कंपाइलर चेतावनी ... विभिन्न प्रकार के प्रकार 'UIDeviceOrientation' के लिए गणना प्रकार 'UIInterfaceOrientation' से लागू रूपांतरण?

_orientation = [UIApplication sharedApplication].statusBarOrientation;

यह पूर्ण चेतावनी है:

Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation' 

कोई भी विचार कैसे मैं इसे ठीक कर सकते हैं?

धन्यवाद!

+0

यह बहुत अस्पष्ट है। यदि आप कर सकते हैं, तो आप कुछ विवरण जोड़ सकते हैं। –

+0

ओह कोड की रेखा है जहां चेतावनी है: _orientation = [UIAplplication sharedAplication] .statusBarOrientation; –

उत्तर

38

कोशिश बदलते

_orientation = [UIApplication sharedApplication].statusBarOrientation; 

_orientation = (UIDeviceOrientation)[UIApplication sharedApplication].statusBarOrientation; 
+1

स्थिति बैरऑरिएंटेशन रिटर्न UIInterfaceOidentation UIDeviceOrientation के बजाय। कास्टिंग गलत लगता है। – justinkoh

2

कैसे इस बारे में के लिए?

UIDeviceOrientation _orientation = [[UIDevice currentDevice] orientation]; 
संबंधित मुद्दे