1

I'm using an IKImageBrowserView and get the error described here. So I should use NSURLs instead of NSStrings/paths. I have changed everything to NSURL now, but get still the same error. I tried using IKImageBrowserNSURLRepresentationType and NSURLPboardType, but this doesn't work, too. When dragging a photo, the console keeps saying:

__CFPasteboardIssueSandboxExtensionForPath: error for ...

My data structure looks like this:

@implementation MyImageObject

- (void) setPath:(NSURL *) path{
    if(myPath != path){
        myPath = path;
    }
}

- (NSString *)  imageRepresentationType{
    return IKImageBrowserPathRepresentationType;
}

- (id)  imageRepresentation{
    return myPath;
}

- (NSURL *) imageUID{
    return myPath;
}

and the imageBrowser writeItemsAtIndexes toPasteboard:

- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard: (NSPasteboard *)pasteboard {

    NSUInteger index;

    //instantiate an array to store paths
    NSMutableArray *filesArray = [NSMutableArray array];

    //for each index...
    for(index = [itemIndexes firstIndex]; index != NSNotFound; index = [itemIndexes indexGreaterThanIndex:index]){

        //...get the path you want to add to the pasteboard
        id myDatasourceItem = [myImages objectAtIndex:index];

        //add it to your array
        [filesArray addObject:[myDatasourceItem imageUID]];
    }

    //declare the pasteboard will contain paths
    [pasteboard declareTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,nil] owner:self];

    [pasteboard writeObjects:filesArray];

    //return the number of items added to the pasteboard
    return [filesArray count];
}

So does anyone know which types I have to use or how to get rid of this error message?

Community
  • 1
  • 1

0 Answers0