2015-03-18 6 views
9

मुद्दा:iCloud UIDocumentPicker रुक-रुक कर दुर्घटनाओं और लटका हुआ है

जब एक दस्तावेज़ iCloud से आवेदन बेतरतीब ढंग से दुर्घटनाओं, समय के सबसे अधिक के लिए निम्न कोड के चुनाव, लेकिन दुर्लभ अवसरों पर यह असफल हो जायेगी।

मैंने ऐप में iCloud एंटाइटेलमेंट सक्षम किया है और यह कारण नहीं लग रहा है कि यह अंतःस्थापित क्यों विफल रहता है। क्या कोई जांच है कि मुझे याद आ रही है?

यह भी अवसरों पर एक ध्यान देने योग्य 5 या तो सेकंड के लिए फांसी है (आमतौर पर दुर्घटनाग्रस्त के लिए दौड़ में)

कोड:

#pragma mark - iCloud ======================================================================================================= 
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url { 

BOOL fileUrlAuthozied = [url startAccessingSecurityScopedResource]; 
NSURL *ubiquityURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; 
NSLog(@"ubiquityURL - %@",ubiquityURL); 

if(fileUrlAuthozied){ 
    NSFileCoordinator *fileCoordinator = [[NSFileCoordinator alloc] init]; 
    NSError *error; 

    [fileCoordinator coordinateReadingItemAtURL:url options:0 error:&error byAccessor:^(NSURL *newURL) { 

     NSData *data = [NSData dataWithContentsOfURL:newURL]; 
     //Do something with data 
     selectedDocumentToUpload = [[UploadDocumentObj alloc] initWithiCloudDocument:data]; 
     [self performSegueWithIdentifier:@"goToRename" sender:nil]; 

    }]; 
    [url stopAccessingSecurityScopedResource]; 
}else{ 
    //Error handling 
    [Lib showErrorMessageWithTitle:@"Alert" message:@"E-Sign could not retrive the document!\nPlease try again." delegate:self]; 

} 
} 

त्रुटि:

2015-03-18 16:22:15.955 E-Sign[6338:1860982] *** Assertion failure in -[UIDocumentPickerViewController _commonInitWithCompletion:], /SourceCache/UIKit/UIKit-3318.93/UIDocumentPickerViewController.m:66 
2015-03-18 16:22:15.960 E-Sign[6338:1860982] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application initializing document picker is missing the iCloud entitlement. Is com.apple.developer.icloud-container-identifiers set?' 

अन्य त्रुटियों:

2015-03-18 16:33:45.884 E-Sign[6357:1864309] plugin com.apple.UIKit.fileprovider.default interrupted 
2015-03-18 16:33:45.885 E-Sign[6357:1864309] plugin com.apple.UIKit.fileprovider.default invalidated 

कोई भी इससे पहले आया है?

+0

मुझे भी होता है, मुझे यकीन नहीं है कि यह केवल विकास का मुद्दा है, या यह उत्पादन पर भी होता है –

+0

यह दोनों में होता है। बाहरी परीक्षक एक ही मुद्दे की रिपोर्ट करते रहते हैं, अंत में मैंने अपनी अविश्वसनीयता – AJ9

उत्तर

0

लगता है कि iCloud एंटाइटेलमेंट के लिए निम्न त्रुटि उत्पन्न हो रही है ठीक से सेट नहीं किया जा रहा है। कृपया इसे दोबारा जांचें। आपके युक्त ऐप और एक्सटेंशन को एक ही ऐप समूह में होना चाहिए। यदि सक्षम नहीं है तो क्षमताओं से ऐप समूह सक्षम करें। यदि दोनों सही ढंग से सेट हैं और फिर भी आपको त्रुटि मिलती है तो इसके बारे में कोई संकेत नहीं है कि यह कहां हो सकता है।

2015-03-18 16:22:15.960 E-Sign[6338:1860982] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application initializing document picker is missing the iCloud entitlement. Is com.apple.developer.icloud-container-identifiers set?' 

मुझे अन्य त्रुटियों का भी सामना करना पड़ रहा है। मैं इसीलिए यहां पर हूं।

+0

के कारण पूरे आईक्लाउड कार्यक्षमता को हटा दिया जैसा कि मूल प्रश्न में चर्चा की गई है, iCloud एंटाइटेलमेंट सक्षम किया गया है। त्रुटि की अस्थायी प्रकृति मुद्दा है। – AJ9

4

मैं हाल ही में एक ही समस्या opon stumpled:

*** Assertion failure in -[UIDocumentPickerViewController _commonInitWithCompletion:]

वजह से कमी ऐप-क्षमताओं को कारण होता है। अपने बिल्ड में जाओ और क्षमताओं चुनें -> iCloud

दाहिने हाथ की ओर स्विच के माध्यम से सक्रिय और टॉगल iCloud दस्तावेज़ और CloudKit पर। (सूचना: यह केवल एक भुगतान डेवलपर खाते के साथ काम करेंगे)

Rebuild-> चलाएँ

भी मन में है:

iCloud entitlements are available only to apps submitted to the App Store or to the Mac App Store. (Source)

0

एक बहुत मैं एक महत्वपूर्ण निष्कर्ष पर पहुंचा शोध करने के बाद:

मैं एक ही तरह के मुद्दे से निपट रहा था और यह वास्तव में चोट लग रहा था। इसलिए कोड को गहरा और डीबग करने के बाद अंतिम परिणाम को यूआई परिवर्तनों को प्रबंधित करना है जिसे आप पिकर प्रदर्शित करते समय कर रहे हैं। पिकर और यूआई परिवर्तनों को प्रदर्शित करने का संक्रमण परेशान व्यवहार उत्पन्न करता है और अंत में दुर्घटनाग्रस्त हो जाता है और लटकता है।

So my suggestion would be minimize the UI updation and make those changes in background so that the opening of picker is seamless.

मेरी समस्या को उन परिवर्तनों के बाद हल किया गया था।

-1

विधि को कॉल करते समय, सुनिश्चित करें कि आप इसे पृष्ठभूमि थ्रेड में कॉल करें। यह समस्या को ठीक करेगा।

dispatch_async (dispatch_get_global_queuue (DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{ // अपनी पद्धति कॉल});

संबंधित मुद्दे