我处理从浏览器视图拖动操作的自定义view.It雪lepoard工作得很好,但不是在山狮与沙箱。拖动文件遇到沙盒(__ CFPasteboardIssueSandboxExtensionForPath)
in browser view:
NSMutableArray* urls = [[[NSMutableArray alloc] init] autorelease];
..............put some NSUrl to urls array....................
[pasteboard writeObjects:[NSArray arrayWithArray:urls]];
in my receive custom view:
NSArray* pasteboardItems = [pasteboard readObjectsForClasses:[NSArray arrayWithObject:[NSString class]] options:nil];
NSArray* pasteboardItems2 = [pasteboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:nil];
NSArray* pasteboardItems3 = [pasteboard readObjectsForClasses:[NSArray arrayWithObject:[NSImage class]] options:nil];
NSLog(@"%@",pasteboardItems);
NSLog(@"%@",pasteboardItems2);
NSLog(@"%@",pasteboardItems3);
my log is:
2012-08-09 18:33:43.886 iCollage[6885:303] __CFPasteboardIssueSandboxExtensionForPath: error for [/Users/xxxx/Library/Containers/xxxxxxxxxxxx/Data/Downloads/1343902069.jpg]
2012-08-09 18:33:44.546 iCollage[6885:303] ("file://localhost/Users/xxx/Library/Containers/xxxxxxxx/Data/Downloads/1343902069.jpg")
2012-08-09 18:33:44.547 iCollage[6885:303] ("file://localhost/Users/xxxxx/Library/Containers/xxxxxx/Data/Downloads/1343902069.jpg")
2012-08-09 18:33:44.547 iCollage[6885:303]()
我的问题是:
1.how修复此错误__CFPasteboardIssueSandboxExtensionForPath;我指的文档,并没有发现任何关于that.I上午ensuer,我要访问该文件的权限谷歌说,!可能是“startAccessingSecurityScopedResource”将帮助我,然后我尝试和失败
2.为什么pasteboardItems2有价值吗?我只写信给粘贴板只有url而不是string.It反感我可以从NSString类型和NSUrl类型! (我试着拖动从iFinder文件,URL将只在pasteboardItems存在,但不pasteboardItems2).Anybody知道为什么吗?我认为当有人帮我解决这个问题时,第一个问题会自动修复。
您是否找到解决此问题的方法?我也越来越这个错误:( – Aravindhan 2012-08-23 14:45:38
@Aravindhanarvi你可以尝试书签范围 – 2012-12-25 07:31:39