• 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
What is my data source ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is my data source ?


  • Subject: What is my data source ?
  • From: Wayne Pascoe <email@hidden>
  • Date: Wed, 10 May 2006 21:07:24 +0100

All,

I'm still kicking my problem of dragging a list of files to an NSTableView. I think I'm on completely the wrong track, and would appreciate some help.

The Apple documentation says

"Implementing the delegate methods in your data source object lets the NSTableView class know that your table supports drag and drop and also lets it know what to do with dragged or dropped data."

I have a relatively simple application, and I'm trying to work out what the data source object is so that I can implement the relevant methods there. I would have thought that my NSArrayController would be the datasource, but I can't work out how to add code there.

The application was created as a Core Data application (not a core data document application). The only .m and .h files I have are my DraggingFiles_AppDelegate files.

I've added an IBOutlet to DraggingFiles_Appdelegate.h as follows:
IBOutlet NSTableView *tableView;

In interface builder, I've added an NSTableView and two buttons (+ and -) to the Window. I then added an NSArrayController (which I _think_ would be my data source). I set this to point to the Files entity, and bound the managedObjectContext to DraggingFiles_AppDelegate with a model key path of managedObjectContext. Finally, I connected the + and - buttons to the NSArrayController's add and delete methods.

I then connected my tableView outlet in DraggingFiles_AppController to the NSTableView.

My question now, is where should I add the drag / drop methods described at http://developer.apple.com/documentation/Cocoa/ Conceptual/TableView/Tasks/UsingDragAndDrop.html and http:// www.corbinstreehouse.com/blog/?p=21 ?

Thanks in advance,

--
Wayne Pascoe    (gpg --keyserver www.co.uk.pgp.net --recv-keys 79A7C870)
They say a Hero is born Brave, but I am here to tell you...
a Hero is a scared man, who doesnt walk away!





Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
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: What is my data source ?
      • From: "Lawrence Sanbourne" <email@hidden>
    • Re: What is my data source ?
      • From: Wayne Pascoe <email@hidden>
  • Prev by Date: Re: NSKeyedUnarchiver questions
  • Next by Date: Re: What is my data source ?
  • Previous by thread: Applescript not calling my code?
  • Next by thread: Re: What is my data source ?
  • Index(es):
    • Date
    • Thread