RE: IKImageBrowserView drag and drop/reordering when using core data [SOLVED]
RE: IKImageBrowserView drag and drop/reordering when using core data [SOLVED]
- Subject: RE: IKImageBrowserView drag and drop/reordering when using core data [SOLVED]
- From: "email@hidden" <email@hidden>
- Date: Sat, 11 Apr 2009 14:53:33 +0100
Regarding this previous post of mine:
http://www.cocoabuilder.com/archive/message/cocoa/2009/1/13/227642
The code listed in that previous posting contains an error which
results in insidious behaviour:
“EXC_BAD_ACCESS” sometimes generated when dragging within
IKBrowserImageView
I had omitted to inform the NSPasteboard of the imminent data type.
/*
write images to paste board
need for dragging of non path represented images
*/
- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:
(NSPasteboard *)pasteboard
{
NSInteger index;
// tell the pasteboard what to expect - required!
[pasteboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType]
owner:nil]; // amended 11-04-09
for (index = [itemIndexes lastIndex]; index != NSNotFound; index
= [itemIndexes indexLessThanIndex:index])
{
GoodThing *goodThing = [[imageBrowserViewArrayController
content] objectAtIndex:index];
[pasteboard setData:goodThing.imageRepresentation
forType:NSTIFFPboardType];
}
return [itemIndexes count];
}
Jonathan Mitchell
Central Conscious Unit
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden