我尝试使用 SMJobBless 功能对我的应用程序进行身份验证,可以在 /Library/Fonts 上写入但无法正常工作,
if (![self blessHelperWithLabel:@"com.apple.bsd.SMJobBlessHelper" error:&error]) {
NSLog(@"Something went wrong! %@ / %d", [error domain], (int) [error code]);
} else {
//Access to this point.
/* At this point, the job is available. However, this is a very
* simple sample, and there is no IPC infrastructure set up to
* make it launch-on-demand. You would normally achieve this by
* using XPC (via a MachServices dictionary in your launchd.plist).
*/
NSLog(@"Job is available!");
bool result = false;
result = [[NSFileManager defaultManager] isWritableFileAtPath:@"/Library/Fonts"];
[self->_textField setHidden:false];
}
我的应用程序打印了“Job is available”但是当我检查当局在 /Library/Fonts 上写的时候,结果是假的
请告诉我原因并解决它。