I need the full path, yes. I know I can get it using NSBundle. But if the app is moved, the string that was previously returned from the call is no longer valid. I need to pass the location to a c library and reset the location in this library when the application is movedhttp://www.me.com/my/mail/en/images/spacer.gif, so I need a way to know when the app is moved. On Wednesday, July 16, 2008, at 10:34PM, "Omar Qazi" <[EMAIL PROTECTED]> wrote: > >On Jul 16, 2008, at 6:08 PM, Mitchell Livingston wrote: > >> I have code that must know where a folder inside the Resources >> folder of the application is. This location must be updated whenever >> the app is moved to another location. Is there some sort of callback >> I can register to receive for this? > >Huh? Where a folder inside the resources folder of an application is? >I'm going to assume you mean the full path of something inside of an >Application bundle. > >You don't need to get a notification when the app is moved. Instead, I >would recommend using NSBundle's pathForResource: ofType: in >combination with NSWorkspace's fullPathForApplication:. So whenever >you needed the path of that folder, you could do something like this: > > >NSString *pathToApp = [[NSWorkspace >sharedWorkspace]fullPathForApplication:@"Whatever Application"]; >NSBundle *appBundle = [[NSBundle alloc]initWithPath:pathToApp]; >NSString *resourcePath = [appBundle >pathForResource:@"WhateverResource" ofType:@"Whatever Type"]; > >Omar Qazi >Hello, Galaxy! >1.310.294.1593 > > > _______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]