• 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
Problem with Service and PasteBoards
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Problem with Service and PasteBoards
      • From: mmalc Crawford <email@hidden>
  • Prev by Date: Re: GC pros and cons
  • Next by Date: Re: Detecting that a process has ended?
  • Previous by thread: Re: NSUrl: Which method to use
  • Next by thread: Re: Problem with Service and PasteBoards
  • Index(es):
    • Date
    • Thread