• 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
How do I register a cocoa bundle identifier?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I register a cocoa bundle identifier?


  • Subject: How do I register a cocoa bundle identifier?
  • From: Jules Colding <email@hidden>
  • Date: Wed, 20 Aug 2008 15:05:57 +0200

Hi,

I have this cocoa bundle which contains an executable (a shell tool) in the "Contents/MacOS" directory. I would like to register to bundle so that I can execute the contained program with "open -b com. 42tools.julia.backend" from the terminal.

I've tried using LSRegisterFSRef() with various paths in the FSRef - the executablePath, the bundlePath and the path of the "Info.plist" file as below:

static void
register_bundle(void)
{
FSRef fsref;
OSStatus oss;
NSBundle *bundle = [NSBundle mainBundle];
NSString *plist = [NSString stringWithFormat:@"%@/Contents/ Info.plist", [bundle bundlePath]];

oss = FSPathMakeRef([plist UTF8String], &fsref, NULL);
NSLog(@"FSPathMakeRef = %d", oss);


	oss = LSRegisterFSRef(&fsref, true);
	NSLog(@"LSRegisterFSRef = %d", oss);
}

LSRegisterFSRef() returns "-10811" ("kLSNotAnApplicationErr") for all of them. Is there a way to do what I want?

Thanks a lot in advance,
  jules


_______________________________________________

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


  • Prev by Date: Re: Best Way to Handle Properties?
  • Next by Date: Re: Right place to unobserve notifications in a document
  • Previous by thread: NSCollectionView keyloop broken, is there a workaround?
  • Next by thread: Outlet Initialization Uses Accessors
  • Index(es):
    • Date
    • Thread