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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to