• 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
CoreData and NSPasteboard for
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData and NSPasteboard for


  • Subject: CoreData and NSPasteboard for
  • From: "Steve@MacDotCom" <email@hidden>
  • Date: Wed, 18 Jan 2006 19:12:36 -0600

Folks;

Since NSManagedObject doesn't implement NSCcoding whats the best way to use the pasteboard for handling CoreData objects?

I've subclassed NSTableView to get some custom row handling, now I want to add some drag and drop between two windows.

Sooo obviously:
- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard {
NSArray *typesArray = [NSArray arrayWithObject:@"myCustomDragDropPboardType"];
[pboard declareTypes:typesArray owner:self];
NSMutableArray *entitiesToCopy = [NSMutableArray arrayWithCapacity:[rows count]];
NSEnumerator *rowEnum = [rows objectEnumerator];
NSData *myPBoardData;
NSNumber * ix = [NSNumber numberWithInt:0];
while ( (ix = [rowEnumerator nextObject]) ) {
[entitiesToCopy addObject:[[self arrangedObjects] objectAtIndex:[ix intValue]]];
}
myPBoardData = [NSKeyedArchiver archivedDataWithRootObject: entitiesToCopy];
return YES;
}


--> 2006-01-18 18:24:09.079 appX[15676] *** -[myCoreDataEntity encodeWithCoder:]: selector not recognized [self = 0x3af9960]

On the other hand, if I try the old school way

[pboard setPropertyList:entitiesToCopy forType:@"myCustomDragDropPboardType"];

I get a empty result for proptryList:forType? Huh?

I've poked around the archives of cocoa-dev and cocoaBuilder but darn if I can find anything on this point!

Any thoughts would be really appreciated!
Steve




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: CoreData and NSPasteboard for
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Two questions about NSCalendar
  • Next by Date: NSLayoutManager subclassing
  • Previous by thread: Re: Two questions about NSCalendar
  • Next by thread: Re: CoreData and NSPasteboard for
  • Index(es):
    • Date
    • Thread