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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to