【发布时间】:2014-10-06 09:59:10
【问题描述】:
我正在尝试为用户提供从登录时开始的选项。但是,当我在没有沙箱的情况下运行应用程序时,下面的代码可以正常工作,但它不能在启用沙箱的情况下工作。我在控制台中看到:SFL(8490): AddNewItemWithProperties_rpc 返回 5
def open_app_at_startup():
app_path = NSBundle.mainBundle().bundlePath()
url = NSURL.alloc().initFileURLWithPath_(app_path)
login_items = LSSharedFileListCreate(kCFAllocatorDefault, kLSSharedFileListSessionLoginItems, None)
props = NSDictionary.dictionaryWithObject_forKey_(True, kLSSharedFileListItemHidden)
v = LSSharedFileListInsertItemURL(login_items,
kLSSharedFileListItemLast,
None,
None,
url,
props,
None)
【问题讨论】:
标签: objective-c cocoa pyobjc appstore-sandbox