• 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
Re: NSService - I need a headslap
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSService - I need a headslap


  • Subject: Re: NSService - I need a headslap
  • From: Steve Cronin <email@hidden>
  • Date: Wed, 04 Feb 2009 09:03:27 -0600

Well, sheesh - that's embarrassing! There is no 'self' until init - I know that! Ugh.

However, that doesn't change my end result!

I never see anything on the Services menu nor anything from the NSLog statements shown below.
(Even when I double-click on the .service file; after whcih I CAN see it in the process list in Activity monitor but still no log messages)
Logging out and back in doesn't make my service name appear on the Service menu...
This is on a 10.5.6 system using a Release build which has been placed in ~/Library/Services.


SO my basic questions still stand:
What event/conditions launches a .service which resides in ~/Library/ Services?
Should/must .service files be 'Background Only'?
Am I missing something basic in my setup here -
I have only a Info.plist and 1 .h (NSObject) and 2 . m files (main and MyService) and no .xib?
Other than the 'wrapper' settings are there other compiler settings required for this setup?
I have only 2 steps in my build process: 'Compile Source (2)' and 'Link Binary w/ Lib (1)' [Cocoa]


To me it feels like there is something basic about the application package that is not right but then I can't seem to keep 'self' straight either...

MyService.m

-(id) init {
	[super init];
	NSLog(@"*[%@ %@]",[self class],NSStringFromSelector(_cmd));
	[NSApp setDelegate:self];
	return self;
}
- (void) applicationDidFinishLaunching:(NSNotification *)aNote {
	[NSApp setServicesProvider:self];
	void NSUpdateDynamicServices(void);
}

- (void) myServiceName:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error {
.....
}





On Feb 4, 2009, at 5:47 AM, Ron Fleckner wrote:


On 04/02/2009, at 7:44 PM, Steve Cronin wrote:

+(void)initialize { [NSApp setDelegate:self]; }

Hi Steve,

as Quincey has suggested, looks like the above is the problem. I've done a stand-alone .service and [NSApp setDelegate:self] is in - (id)init, not + (void)initialize.

Ron

_______________________________________________

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: NSService - I need a headslap
      • From: Michael Ash <email@hidden>
    • Re: NSService - I need a headslap
      • From: Peter Ammon <email@hidden>
    • Re: NSService - I need a headslap
      • From: Quincey Morris <email@hidden>
References: 
 >NSService - I need a headslap (From: Steve Cronin <email@hidden>)
 >Re: NSService - I need a headslap (From: Ron Fleckner <email@hidden>)

  • Prev by Date: Re: NSTask in separate thread is leaking memory
  • Next by Date: Re: Open OtherApp just behind MyApp
  • Previous by thread: Re: NSService - I need a headslap
  • Next by thread: Re: NSService - I need a headslap
  • Index(es):
    • Date
    • Thread