Building a Mac OS X/Cocoa application for distribution with an imported framework
Asked Answered
A

1

8

So I built an application which compiles and runs fine from Xcode. Now I want to distribute it to other people so they can use it. How do I do that correctly?

I thought it was as simple as archiving it, and then sharing it as a .pkg or an application. But whenever I open up the application it crashes with the following message:

Application Specific Information: 
dyld: launch, loading dependent libraries 
Dyld Error Message: 
  Symbol not found: _OBJC_CLASS_$_CPTBorderedLayer 
  Referenced from: /Users/USER/Desktop/StoreMon.app/Contents/MacOS/ 
StoreMon 
  Expected in: /Library/Frameworks/CorePlot.framework/Versions/A/ 
CorePlot 
 in /Users/USER/Desktop/StoreMon.app/Contents/MacOS/StoreMon 

I am using the Core Plot framework.

The _CPTBorderedLayer class is part of that framework. How do I package this framework into my app correctly?

Again answered 16/8, 2011 at 7:5 Comment(0)
D
7

You can provide an installer for the framework(s) you are using, or you can embed them in your Application's bundle.

Read the "Framework Programming Guide". Page 41 is what you are looking for:

http://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/BPFrameworks.pdf

The trick is to copy the framework files in a special directory, inside your application. Then, you'll use @executable_path to refer to your application's binary path, so the application's will be correctly linked to your framework at launch time.

Demi answered 16/8, 2011 at 8:29 Comment(1)
The link is dead.Beacon

© 2022 - 2024 — McMap. All rights reserved.