English 中文(简体)
如何在程序启动时解开框架链接
原标题:How to unlink a framework on program start

我正在开发iPhone OS 3.1.3, 我需要使用投影箱API。

问题是投放箱API至少需要 iOS 4.2.。

我决定保留在3.1.3下使用该方案的可能性,但如果方案4.2及以上,将具有 " 滴箱 " 功能。

要使用我需要的“放箱”框架来连接另一个框架:

  • Security.framework
  • QuartzCore.framework

我这样做了。

当我链接 Dropbox. framework 到我的项目时, 这个程序在 iPhone 模拟器上效果很好, 但无法在我的 iPhone 3.1.3 上启动。 输出有错误 :


dyld: Symbol not found: _kSecAttrAccessible Referenced from: /var/mobile/Applications/C1FC10E5-0A36-4DEB-BD27-5028C205C89D/Bus Time.app/Bus Time Expected in: /System/Library/Frameworks/Security.framework/Security in /var/mobile/Applications/C1FC10E5-0A36-4DEB-BD27-5028C205C89D/Bus Time.app/Bus Time


所以问题是:

Can I detect the iOS version on the program start and unlink the framework? Or could you offer an another way to use dropbox for 3.1.3?

谢谢你的回答,我很感激

最佳回答

您无法在运行时从程序上取消框架的链接 。

您可以在运行时程序上 < em> link 框架, 例如, 使用 NSBundle APIs, 或 dloopen, 或其他方式。 如果您这样做, 您必须手动装入您想要的 ObjC 对象和/ 或 C 符号 。

或者,您可以将使运行时间为您做大部分工作的框架连接到软链接中。 如果它在那里, 它将在启动时被装入, 并且它的所有 ObjC 对象和 C 符号都将可供您使用。 否则, 它的所有 ObjC 对象和 C 符号都将无效。 因此, 您只需要检查无效即可决定是否运行需要该框架的代码 。

问题回答
  1. Select the Security framework in your file list.
  2. Expand the right sidebar (View > Utilities > Show Utilities).
  3. Under Target Membership change Required to Optional.




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签