iPhone-Core-Daten "Produktion" Fehlerbehandlung

Ich gesehen habe in der Beispiel-code geliefert von Apple Hinweise darauf, wie Sie behandeln soll, die Core-Daten-Fehler. I. e:

NSError *error = nil;
if (![context save:&error]) {
/*
 Replace this implementation with code to handle the error appropriately.

 abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
 */
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    abort();
}

Aber nie Beispiele dafür, wie Sie sollte umzusetzen.

Hat jemand (oder kann mir in der Richtung) einige tatsächliche "Produktion" code veranschaulicht die oben genannten Methode.

Vielen Dank im Voraus,
Matt

  • +1 das ist eine ausgezeichnete Frage.
InformationsquelleAutor Sway | 2010-02-14
Schreibe einen Kommentar