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: Mon, 08 Sep 2014 13:15:34 +0200
On 03 Sep 2014, at 01:20, email@hidden wrote:
>
>
> Sent from my iPhone
>
>> On 2014/09/03, at 3:45, Georg Seifert <email@hidden> wrote:
>>
>> 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
> It's a bit more work, but if you supplied the service via a helper app embedded in your app bundle, does that make it work?
I didn't see anything in the docs about how to set it up. Can you just set the post name to the helper apps name? who would be responsible for first starting the app?
Are there any examples on how to set it up?
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