Re: My services in my own app
Re: My services in my own app
- Subject: Re: My services in my own app
- From: Georg Seifert <email@hidden>
- Date: Tue, 02 Sep 2014 20:45:10 +0200
Here are some more information.
I created a small test app following the example on apples documentation. The service works fine if invoked from other apps but if you select it from within the same app with text selected in a text view, the app menu will stay highlighted for 30s and after that it will give an error dialog:
> The “reverse String” service could not be used because the application did not respond to a request for services.
> Try reopening “(null),” or contact the vendor for an updated version.
This is the backtrace (if I press pause in the debugger during that 30s):
#0 0x00007fff8d805a1a in mach_msg_trap ()
#1 0x00007fff8d804d18 in mach_msg ()
#2 0x00007fff8d434f15 in __CFRunLoopServiceMachPort ()
#3 0x00007fff8d434539 in __CFRunLoopRun ()
#4 0x00007fff8d433e75 in CFRunLoopRunSpecific ()
#5 0x00007fff8872ea0d in RunCurrentEventLoopInMode ()
#6 0x00007fff8872e7b7 in ReceiveNextEventCommon ()
#7 0x00007fff8872e5bc in _BlockUntilNextEventMatchingListInModeWithFilter ()
#8 0x00007fff8ddbe24e in _DPSNextEvent ()
#9 0x00007fff8ddbd89b in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#10 0x00007fff8e55f85d in _checkForUserCancelledEventUpToDate ()
#11 0x00007fff8e560d92 in +[NSServicesMenuHandler _performServiceFromEntry:withPasteboard:withRequestor:withCarbonFocus:withSendTypes:withReturnTypes:canReleasePasteboardImmediately:] ()
#12 0x00007fff8e56150d in +[NSServicesMenuHandler _performServiceFromEntry:withPasteboard:withRequestor:] ()
#13 0x00007fff8dfdc260 in -[NSApplication sendAction:to:from:] ()
#14 0x00007fff8dff71c8 in -[NSMenuItem _corePerformAction] ()
#15 0x00007fff8dff6f04 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] ()
#16 0x00007fff8e04640d in -[NSMenu _internalPerformActionForItemAtIndex:] ()
#17 0x00007fff8e046289 in -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] ()
#18 0x00007fff8dfecff6 in NSSLMMenuEventHandler ()
#19 0x00007fff887081d4 in DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) ()
Here is the app:
https://dl.dropboxusercontent.com/u/3563666/ServiceTest.zip (app and sources).
First activate the Service "reverse String" in System Preferences.
Open a new document, type something, select it and run the filter.
I think is happens if both, the NSSendTypes and NSReturnTypes are set. Services that only have one seem to work fine.
If anyone can help me with this?
Best
Georg
On 01 Sep 2014, at 21:30, Georg Seifert <email@hidden> wrote:
> Just wanted to follow up on this. The bug is not fixed. It is still there in 10.9. Any other news on it?
>
> Georg
>
> On 16 Jan 2012, at 22:27, Mark Munz <email@hidden> wrote:
>
>>
>> You didn't indicate what version of Mac OS X you were running under.
>>
>> If this is happening under Snow Leopard, then this is a known issue in
>> Snow Leopard that Apple fixed in Lion.
>>
>> The only work around I know is to put the service code in a separate
>> (background) application that then calls back into your app to do
>> whatever task you need it to do.
>>
>> Mark
>>
>>> Hi,
>>>
>>> My app registers some services and they work just fine. Only if I invoke then from within the same application, the app hangs. I tried with other apps and they had the same problem.
>>>
>>> I searched the web for it but could not find anything.
>>>
>>> Is there anything I can do about it?
>>>
>>> Thanks
>>> Georg
>
>
> _______________________________________________
>
> 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
_______________________________________________
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