Difficulty Calling NSTableView's validateDrop: Method for Unit Testing
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