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

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

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

किसी फ़ाइल को मिटाने के लिए, पहले उस फ़ाइल की रेफ़रंस बनाएं. इसके बाद, उस रेफ़रंस पर 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
  }
}];
    

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

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