Where is NSAlert.h in the iOS SDK?

后端 未结 3 1013
逝去的感伤
逝去的感伤 2020-12-11 03:27

According to iOS\'s Using and Creating Error Objects, one can display a error object with the following code.

NSError *theError = nil;
BOOL success = [myDoc          


        
3条回答
  •  轮回少年
    2020-12-11 03:42

    NSAlert isn't availble in UIKit. the example it just an copy past of the OS X doc.

    This code in Listing 2-1 uses the returned NSError to display an error alert to the user immediately. (UIAlertView, the UIKit class corresponding to NSAlert, has no equivalent method for alertWithError:.) Error objects in the Cocoa domain are always localized and ready to present to users, so they can often be presented without further evaluation.

提交回复
热议问题