Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Service will not work ;(

Service will not work ;(
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Germany
Status: Offline
Reply With Quote
Apr 22, 2001, 05:19 AM
 
Hi!

I'm working on making my Application (manThor) a service right now.

It registers as a service and it is launched, when I select it from another cocoa app. But after that happens manThor doesn't do anything and the requesting app hangs(beachball). Has anyone experienced this before?

This happens even when I do not do anything inside "doSearchService". I believe it has something to do with the info.plist, which contains this:

<key>NSServices</key>
<array>
<dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Show with manThor</string>
</dict>
<key>NSMessage</key>
<string>doSearchService</string>
<key>NSPortName</key>
<string>manThor</string>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType&lt ;/string>
</array>
<key>NSUserData</key>
<string>0</string>
</dict>
</array>

PLEASE help me

regards
Stefan
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
     
ali
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
Apr 22, 2001, 01:12 PM
 
Is your service implemented as:

- (void)doSearchServiceNSPasteboard *)pboard userDataNSString *)data errorNSString **)error {
...
}

Did you specify your service provider?

[NSApp setServicesProvider:objectProvidingService];

(You could do this in applicationDidFinishLaunching:, for instance.)

You can run in the debugger and see if your service is getting called.

Ali


     
Phure  (op)
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Germany
Status: Offline
Reply With Quote
Apr 22, 2001, 01:59 PM
 
Whow!
I found the problem, I placed [NSApp setServicesProvider bjectProvidingService]; in applicationDidFinishLaunching:, but I accessed interface elements - which were loaded from the nib file. After moving [NSApp setServicesProvider bjectProvidingService]; to awakeFromNib it suddenly started working.
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2