2014-09-20 9 views
5

UIAlertView और UIActionSheet में ठीक से प्रदर्शित नहीं हो रहा है IOS 8 में ठीक से प्रदर्शित नहीं हो रहा है, इसके दृश्य नियंत्रक को छुपा रहा है, यहां तक ​​कि अलर्ट व्यू शीर्षक भी प्रदर्शित नहीं हो रहा है। मैं एक्सकोड 5.1.1 से ऐप चला रहा हूं।UIAlertView और UIActionSheet आईओएस 8

Action Sheet

Alert View

उत्तर

5

क्या आपने अपने एप्लिकेशन में व्यू कंट्रोलर के लिए कोई श्रेणी जोड़ा है। नीचे दिखाए गए

@implementation UIViewController (CustomeAction) 
- (void)setTitle:(NSString *)title{ 
// YOU CODE/// 
} 
@end 

यह समस्या हो सकती है। मैंने इस श्रेणी को हटाकर हल किया है - (void)setTitle:(NSString *)title.

नोट: आईओएस 8 से, UIAlertViewController को UIViewController से विरासत में मिला है। यदि आप श्रेणी विधि का उपयोग करते हैं, तो यह UIAlertView & UIActionSheet शीर्षक पर प्रभावी होगा।

आप UIAlertController Class Reference

+0

महान ... इसके ठीक काम कर रहा के लिए कोड निम्न का उपयोग कर सकते ... धन्यवाद – Surfer

+0

आपका स्वागत है, अगर आपको शीर्षक सेट करने की आवश्यकता है तो आप UINavigationItem के लिए श्रेणी लिख सकते हैं। – Nookaraju

+0

ठीक है। आपका बहुत बहुत धन्यवाद.. – Surfer

0

ऐसा लगता है, कि UIAlertView और UIActionSheet आईओएस 8. में पदावनत है आप बाहर this question या apple link देख सकते हैं। यह आपकी मदद करेगा।

0

पर सेब डॉक्स उल्लेख कर सकते हैं आप XCode 6 और आईओएस 8

UIAlertController * alert= [UIAlertController 
           alertControllerWithTitle:@"Title" 
           message:@"Your Message" 
           preferredStyle:UIAlertControllerStyleAlert]; 

    UIAlertAction* ok = [UIAlertAction 
         actionWithTitle:@"OK" 
         style:UIAlertActionStyleDefault 
         handler:^(UIAlertAction * action) 
         { 
          [alert dismissViewControllerAnimated:YES completion:nil]; 

         }]; 
    UIAlertAction* cancel = [UIAlertAction 
          actionWithTitle:@"Cancel" 
          style:UIAlertActionStyleDefault 
          handler:^(UIAlertAction * action) 
          { 
           [alert dismissViewControllerAnimated:YES completion:nil]; 

          }]; 

    [alert addAction:ok]; 
    [alert addAction:cancel]; 

    [self presentViewController:alert animated:YES completion:nil]; 

के लिए UIAlerController का उपयोग कर ActionSheet

UIAlertController * alert= [UIAlertController 
            alertControllerWithTitle:@"Title" 
            message:@"Your Message" 
            preferredStyle:UIAlertControllerStyleActionSheet];