开发者

Filemanager not working in QuickLook plugin

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜