• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: IKImageBrowserView drag and drop/reordering when using core data [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Undocumented flags in LSCopyItemInfoForRef
  • Next by Date: Re: WebKit Caching
  • Previous by thread: Re: [SOLVED] Rendering OpenGL in timed loop (CoreVideo).
  • Next by thread: Re: NSTextFieldCell text color issue in NSTableView with source list highlighting
  • Index(es):
    • Date
    • Thread