Problem with Service and PasteBoards
Problem with Service and PasteBoards
- Subject: Problem with Service and PasteBoards
- From: Guillem Palou <email@hidden>
- Date: Sat, 27 Jun 2009 13:13:42 -0400
Hi all,
I have a problem with a nsservice provider. The problem is that I
correctly call the service using NSServiceProvider without errors and
the service executes perfectly.
But at the time to return my Data Type, it fails. I declared a custom
data type named @"dictionaryPBoardType" but I can't get it on return;
Here is the Info.plist file:
<key>NSServices</key>
<array>
<dict>
<key>NSMessage</key>
<string>serviceMovieInfo</string>
<key>NSPortName</key>
<string>MovieInfoReport</string>
<key>NSReturnTypes</key>
<array>
<string>dictionaryPBoardType</string>
</array>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
</array>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Get Movie Info</string>
</dict>
</dict>
</array>
The application calls the service like I show below:
NSPasteboard *pboard = [NSPasteboard pasteboardWithUniqueName];
NSArray *typesDeclared;
typesDeclared = [NSArray arrayWithObjects:NSStringPboardType, nil];
[pboard declareTypes:typesDeclared owner:nil];
[pboard setString:[[files objectAtIndex:i] objectForKey:@"path"]
forType:NSStringPboardType];
NSPerformService(@"Get Movie Info", pboard);
NSLog(@"%@", [pboard types]);
But the Log always shows the same string I sent. I registered the
application for the return types and sent types and the code executes
with no errors.
Any ideas about what's going on? Thanks to all!
Guillem
_______________________________________________
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