Apple प्लैटफ़ॉर्म पर Cloud Storage का इस्तेमाल करके फ़ाइलें मिटाना

Cloud Storage में फ़ाइलें अपलोड करने के बाद, उन्हें मिटाया भी जा सकता है.

*.appspot.com

कोई फ़ाइल मिटाना

किसी फ़ाइल को मिटाने के लिए, पहले रेफ़रंस बनाएं उस फ़ाइल का. इसके बाद, उस रेफ़रंस पर deleteWithCompletion: तरीके को कॉल करें.

Swift

// Create a reference to the file to delete
let desertRef = storageRef.child("desert.jpg")

do {
  // Delete the file
  try await desertRef.delete()
} catch {
  // ...
}
    

Objective-C

// Create a reference to the file to delete
FIRStorageReference *desertRef = [storageRef child:@"images/desert.jpg"];

// Delete the file
[desertRef deleteWithCompletion:^(NSError *error){
  if (error != nil) {
    // Uh-oh, an error occurred!
  } else {
    // File deleted successfully
  }
}];
    

गड़बड़ियों को ठीक करना

फ़ाइलें मिटाने पर गड़बड़ियां आने की कई वजहें हो सकती हैं. जैसे, फ़ाइल का मौजूद न होना या उपयोगकर्ता के पास बताई गई फ़ाइल को मिटाने की अनुमति न होना. गड़बड़ियों के बारे में ज़्यादा जानकारी, दस्तावेज़ों के गड़बड़ियां ठीक करना सेक्शन में देखी जा सकती है.