Table View not Getting Drag messages
Table View not Getting Drag messages
- Subject: Table View not Getting Drag messages
- From: Greg Hulands <email@hidden>
- Date: Wed, 26 May 2004 10:04:03 +1000
Hi,
I have two table views that I am trying to get drag and drop working in
them. It is for an ftp client and the local file table listens for the
remote type and the remote table listens for the local type. I register
the drag type is the awake from nib as below.
[localTable registerForDraggedTypes:[NSArray
arrayWithObject:FTPRemoteFilePBoardType]];
[remoteTable registerForDraggedTypes:[NSArray
arrayWithObject:FTPLocalFilePBoardType]];
In the data source methods for the table's dragging (which does get
called) I write the file selections to the plist like below
- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows
toPasteboard:(NSPasteboard *)pboard
{
NSLog(@"Writing Rows");
if (tableView == localTable)
{
NSMutableArray *files = [NSMutableArray array];
NSEnumerator *e = [rows objectEnumerator];
NSNumber *cur;
while (cur = [e nextObject])
{
NSString *file = [localFiles objectAtIndex:[cur intValue]];
[files addObject:file];
}
[pboard setPropertyList:files forType:FTPLocalFilePBoardType]; //
return YES;
}
else if (tableView == remoteTable)
{
NSMutableArray *f = [NSMutableArray array];
NSEnumerator *e = [rows objectEnumerator];
NSNumber *cur;
while (cur = [e nextObject])
{
NSDictionary *file = [remoteFiles objectAtIndex:[cur intValue]];
if ([[file objectForKey:FTPDirectoryTypeKey] intValue] ==
FTPDirectoryTypeDirectory)
[f addObject:[file objectForKey:FTPDirectoryFilenameKey]];
}
[pboard setPropertyList:f forType:FTPRemoteFilePBoardType]; //
return YES;
}
return NO;
}
From here on in, none of the other datasource drag methods are getting
called and I cannot figure out why. Does anyone have a logical
explanation as to why a drag method would not get called?
Any help is greatly appreciated.
Regards,
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.