OSStatus myStatus; AuthorizationFlags myFlags = kAuthorizationFlagDefaults; AuthorizationRef myAuthorizationRef; myStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, myFlags, &myAuthorizationRef); if (myStatus != errAuthorizationSuccess) { return myStatus; } AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0}; AuthorizationRights myRights = {1, &myItems}; myFlags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights; myStatus = AuthorizationCopyRights (myAuthorizationRef, &myRights, NULL, myFlags, NULL ); if (myStatus == errAuthorizationSuccess) { [self delFileFrom:IREDA_PATH Use:myAuthorizationRef]; } AuthorizationFree (myAuthorizationRef, kAuthorizationFlagDefaults); NSLog(@"卸载完成");