• 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
Difficulty Calling NSTableView's validateDrop: Method for Unit Testing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Difficulty Calling NSTableView's validateDrop: Method for Unit Testing


  • Subject: Difficulty Calling NSTableView's validateDrop: Method for Unit Testing
  • From: Mark Szymczyk <email@hidden>
  • Date: Mon, 06 Feb 2012 21:22:46 -0500

I'm trying to unit test drag and drop rearranging of items in a table view. In my unit testing code I have an object of a NSDocument subclass.

MyDocument* testDoc;

The NSDocument subclass has a table view outlet.

IBOutlet NSTableView* myTableView;

I start my unit test by creating a mock object that implements the NSDraggingInfo protocol.

id mock = [OCMockObject mockForProtocol:@protocol(NSDraggingInfo)];

I use the mock object as an argument to NSTableView's validateDrop: method, like the following code:

NSDragOperation theDrag = [xyz
	tableView:myTableView
	validateDrop:mock
	proposedRow:1
	proposedDropOperation:NSTableViewDropAbove];

What do I replace xyz with in my call to validateDrop:? I tried supplying testDoc, myTableView, NSDocument, and NSTableView, but they generate syntax errors. I searched Google for examples, but all I found were examples on how to write a validateDrop: method to handle drag and drop in my code. I didn't find any examples of calling validateDrop:.

Mark
_______________________________________________

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: Difficulty Calling NSTableView's validateDrop: Method for Unit Testing
      • From: Dave Fernandes <email@hidden>
  • Prev by Date: Re: TextEdit - Open Recent - slow
  • Next by Date: Re: ical UI
  • Previous by thread: Re: ical UI
  • Next by thread: Re: Difficulty Calling NSTableView's validateDrop: Method for Unit Testing
  • Index(es):
    • Date
    • Thread