开发者

Filemanager not working in QuickLook plugin

开发者 https://www.devze.com 2023-03-13 00:29 出处:网络
Actually i want to read and write the file using filemanager in Quicklook plugin. The code works fine in the seperate cocoa applications but when the code is embedded in the QuickLoo开发者_Python百科k

Actually i want to read and write the file using filemanager in Quicklook plugin. The code works fine in the seperate cocoa applications but when the code is embedded in the QuickLoo开发者_Python百科k application it just crashes and retuerns the " execute bad excess" error.

the code used to read the file is as below:

NSString* licPref = [[[NSString alloc] init] autorelease];
NSFileManager* fileManager = [NSFileManager defaultManager];
if ( [fileManager fileExistsAtPath:@"/Library/QuickLook/IndesignQL.qlgenerator/.lic.txt"] ){

    licPref = [[NSString alloc] stringWithContentsOfFile:@"/Library/QuickLook/IndesignQL.qlgenerator/.lic.txt"];

}

Thanks in advance...


Quicklook works in sandboxed environment. You cannot access the file system using NSFileManager.

0

精彩评论

暂无评论...
验证码 换一张
取 消