• 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: Drag and drop between two table views.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag and drop between two table views.


  • Subject: Re: Drag and drop between two table views.
  • From: Graham Cox <email@hidden>
  • Date: Thu, 28 Oct 2010 14:57:27 +1100

On 28/10/2010, at 2:38 PM, Paul Johnson wrote:

> Thanks, Graham. I've almost got it working. I did implement the drop validation method and in my initWithNib method I did set up the destination to receive the drag type. That's all working fine.
>
> I took your suggestion to archive the array to a NSData object. I needed to implement encodeWithCoder for the object that defines the data for a row (containing 3 columns with an NSString in each column). I used the Data Modeler to define the row objects and then created the initial declaration and implementation files. Now I needed to added encodeWithCoder and initWithCoder methods.
>
> Now I'm getting the message "Failed to call designated initializer on NSManagedObject class 'Market'"
> when I try to unarchive. I'm really unclear on how to work with Core Data in this situation.

Umm. Me neither.


> The source table and destination table are each supplied data using separate managed object contexts. (The model for the destination table just has an additional relationship defined, but the attributes are the same otherwise.) I just need to move the three NSStrings for each selected row.  I don't see why I need to mess with NSManagedObject class.
>
> What I probably should be doing is writing to the pasteboard an array that only has the 3 NSStrings per selected row, leaving out anything about managed objects. I'm not sure how to do that.

That sounds like a possible solution, though there might be something smarter in Core Data that allows what you're trying to do, but C/D isn't something I know a lot about.

If the three strings are properties of the object, it should be easy enough to pull them out into, say, an array then add each 3-string array to one grand array. That would be compatible with property lists. After dearchiving you'd need to create new Core Data objects and put the string triplets into them. Again, I don't know anything about that.

I'm sure C/D has a solution for cut/paste and drag/drop however, so perhaps someone can point you in the right direction before you go down the path of a convoluted workaround that may not be needed.

--Graham



_______________________________________________

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

  • Follow-Ups:
    • Re: Drag and drop between two table views.
      • From: Paul Johnson <email@hidden>
References: 
 >Drag and drop between two table views. (From: Paul Johnson <email@hidden>)
 >Re: Drag and drop between two table views. (From: Graham Cox <email@hidden>)
 >Re: Drag and drop between two table views. (From: Paul Johnson <email@hidden>)
 >Re: Drag and drop between two table views. (From: Graham Cox <email@hidden>)
 >Re: Drag and drop between two table views. (From: Graham Cox <email@hidden>)
 >Re: Drag and drop between two table views. (From: Paul Johnson <email@hidden>)

  • Prev by Date: Adding and removing menu items causes memory usage to grow
  • Next by Date: Re: Adding and removing menu items causes memory usage to grow
  • Previous by thread: Re: Drag and drop between two table views.
  • Next by thread: Re: Drag and drop between two table views.
  • Index(es):
    • Date
    • Thread