在iPhone中加载自定义框架

在iPhone中加载自定义框架

本文介绍了在iPhone中加载自定义框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对UPnP使用浏览的iPhone。该框架完美地在Mac上工作,但是当我将它复制到iPhone应用程序,即使没有使用框架的代码,它也不会运行。



这是一个奇怪的错误,我不明白。

  [session started at 2008-10-20 15:32:34 +0200。] 
objc [2701]:类CAAnimationGroup在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore中实现, /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:Class CATransition在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CAKeyframeAnimation在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:CABasicAnimation类在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CAPropertyAnimation在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CAAnimation在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CASlotProxy在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:CAContextImpl类在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:CAContext类在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CAFilter在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CALayer是在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现的/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CAMediaTimingFunction在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:类CAScrollLayer在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:CATransaction类在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:CATransformLayer类在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:CATiledLayer类在/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/Frameworks/QuartzCore.framework/QuartzCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore的实现。
objc [2701]:NSCursor类在/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk中实现/System/Library/PrivateFrameworks/WebCore.framework/WebCore。使用来自/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore的实现。

[session started at 2008-10-20 15:32:37 +0200。]
将程序加载到调试器中
GNU gdb 6.3.50-20050815(Apple版本gdb -962)(7月26日星期六08:14:40 UTC 2008)
版权所有2004 Free Software Foundation,Inc.
GDB是免费软件,由GNU通用公共许可证覆盖,您是
欢迎在特定条件下更改和/或分发其副本。
键入显示复制以查看条件。
GDB绝对没有保修。有关详细信息,请键入显示保修。
此GDB配置为i386-apple-darwin.warning:无法读取/System/Library/Frameworks/UIKit.framework/UIKit(找不到文件)的符号。
警告:无法从UIKit读取符号(尚未映射到内存中)。
警告:无法读取/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics(找不到文件)的符号。
警告:无法从CoreGraphics读取符号(尚未映射到内存中)。
程序加载。
sharedlibrary apply-load-rules all
附加到程序:`/ Users / danielchong / Library / Application Support / iPhone模拟器/用户/应用程序/ 305F04A8-840D-4A1A-ADD8-59CEC674152E / uPnP Browser2。
(gdb)


解决方案

iPhone不支持任何类型的动态链接。我认为你试图做动态链接的事实是混淆模拟器的仔细的库加载thingamagig(如果我不误认为它是上面的错误的源)。



如果许可证允许这样做,请将外部UPnP代码静态链接到您的应用程序中。


I'm trying to use an external framework for UPnP browsing on the iPhone. The framework works perfectly on the Mac, But when I copy it to the iPhone app, it wouldn't run even if there's no code using the framework yet.

It gives weird error that I can't understand.

[Session started at 2008-10-20 15:32:34 +0200.]
objc[2701]: Class CAAnimationGroup is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CATransition is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAKeyframeAnimation is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CABasicAnimation is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAPropertyAnimation is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAAnimation is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CASlotProxy is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAContextImpl is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAContext is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAFilter is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CALayer is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAMediaTimingFunction is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CAScrollLayer is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CATransaction is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CATransformLayer is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class CATiledLayer is implemented in both /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.
objc[2701]: Class NSCursor is implemented in both /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore. Using implementation from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore.

[Session started at 2008-10-20 15:32:37 +0200.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols for "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/danielchong/Library/Application Support/iPhone Simulator/User/Applications/305F04A8-840D-4A1A-ADD8-59CEC674152E/uPnP Browser2.app/uPnP Browser2', process 2701.
(gdb)
解决方案

Dynamic linking of any kind is not supported on the iPhone. I think the fact you're trying to do dynamic linking is confusing the simulator's careful library loading thingamagig (which if I'm not mistaken it's the source of the errors above).

If the license allows this, link the external UPnP code statically into your app instead.

这篇关于在iPhone中加载自定义框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 21:14