Re: absolutePathForAppBundleWithIdentifier:(returns nil)
Re: absolutePathForAppBundleWithIdentifier:(returns nil)
- Subject: Re: absolutePathForAppBundleWithIdentifier:(returns nil)
- From: Matt Neuburg <email@hidden>
- Date: Sun, 27 Mar 2005 09:31:59 -0800
On Sat, 26 Mar 2005 14:10:01 -0600, Chris Outwin <email@hidden> said:
>I must be making a fundamental error
You must be. But since you don't show any code, how can anyone say what it
is? It really beats me what it is that people expect of this list when they
post these coy messages. "Please solve my problem by telepathy, since I'm
not going to give you any information - what I'm doing, why I'm doing it..."
>with
>absolutePathForAppBundleWithIdentifier: as it returns nil. I can
>obtain a workspace reference OK, but using the workspace ref with this
>method returns nil when I supply the CFBundleIdentifier from my
>Info.plist.
It is not enough to obtain *a* workspace reference; you must obtain *the*
workspace reference. If you're doing that correctly, then it could be that
you're supplying a misspelled identifier. Look in Library/Preferences and
see what the correct spelling is (from the plist file). After all, you've
only got two places to go wrong, so clearly you're going wrong in one of
them. This works fine OMM:
- (IBAction)myAction:(id)sender
{
NSWorkspace* w = [NSWorkspace sharedWorkspace];
NSString* p = [w absolutePathForAppBundleWithIdentifier:
@"com.neuburg.matt.memorystick"];
NSLog(@"%@", p);
}
Finally, note that if you're doing this because your application wants to
know its own pathname, this is not the way to do it: use NSBundle. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden