> On 24 Dec 2015, at 07:36, Alex Kac <a...@webis.net> wrote: > > I’ve got an app with a helper in the Contents/Library/LoginItems path. Both > use AFNetworking.framework. I currently install AFNetworking.framework in the > main app’s Framework path. I would like the helper to use AFNetworking from > the main app’s Framework’s folder. > > I’ve tried setting the run path search path to something like > @executable_path/../../../../../Frameworks > > but it still doesn’t run - coming back to me with an error that it can’t load > the dynamic library AFNetworking. As mostly an iOS developer for the last 8 > years, how Xcode handles frameworks and how to get embedded stuff like this > to work isn’t really something I have a lot of experience with. So I’m hoping > perhaps someone has some help?
Works the same on OSX as iOS, which is rather helpful. Remember that @executable_path expands to the directory the executable is in, so you often need one less ‘..’ than you think. I believe that the executable_path for embedded helpers is sane (ie it’s the path to the helper) but I would check that. Either way - find the helper, run ‘otool -L’ on it and see exactly what it prints out to make sure you’ve put the right bits in there, then go count double-dots. You can also use @loader_path which in many cases gives you the same thing as @executable_path but is better when frameworks link other frameworks as it gives you what you often really wanted. You can use @rpath too, but then you still have to work out what paths to embed in the binary to search which often ends up being @loader_path/../../something/else anyway, so you need to find the answer to your original question anyway. In here are a load of environment variables you can set which spew information about dynamic loading, which may tell you what’s been tried and hence why it wasn’t found. https://developer.apple.com/library/mac/technotes/tn2124/_index.html#//apple_ref/doc/uid/DTS10003391-CH1-SECDYLD <https://developer.apple.com/library/mac/technotes/tn2124/_index.html#//apple_ref/doc/uid/DTS10003391-CH1-SECDYLD> _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com