我處理從瀏覽器視圖拖動操作的自定義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