我有基于3.0 iPhone OS SDK的应用程序 其中一项任务是播放视频(我使用MPMoviePlayerController执行此任务) 现在我尝试使通用应用程序在3.0和3.2操作系统上运行 我完成了apple documentation中描述的所有步骤:升级iPad的当前目标;使用
对符号进行运行时检查[[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)]
功能。但是当我在设备上启动我的应用程序 - 带有OS 3.1.3的iPhone时,我的应用程序崩溃了下一个日志:
Tue May 25 18:00:28 unknown SpringBoard[24] <Notice>: MultitouchHID(208b30) uilock state: 1 -> 0
Tue May 25 18:00:29 unknown SpringBoard[24] <Notice>: MultitouchHID(292580) device bootloaded
Tue May 25 18:00:34 unknown UIKitApplication:...[0xaa0f][1517] <Notice>: dyld: Symbol not found: _MPMoviePlayerWillEnterFullscreenNotification
Tue May 25 18:00:34 unknown UIKitApplication:...[0xaa0f][1517] <Notice>: Referenced from: /var/mobile/Applications/876EA35E-5756-436B-A9E2-5481D4D62050/....app/...
Tue May 25 18:00:34 unknown UIKitApplication:...[0xaa0f][1517] <Notice>: Expected in: /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
Tue May 25 18:00:35 unknown kernel[0] <Debug>: launchd[1517] Builtin profile: container (seatbelt)
Tue May 25 18:00:35 unknown kernel[0] <Debug>: launchd[1517] Container: /private/var/mobile/Applications/876EA35E-5756-436B-A9E2-5481D4D62050 (seatbelt)
Tue May 25 18:00:35 unknown ReportCrash[1518] <Notice>: Formulating crash report for process cnetmobile[1517]
Tue May 25 18:00:36 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:...[0xaa0f]) Job appears to have crashed: Trace/BPT trap
Tue May 25 18:00:36 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:...[0xaa0f]) Throttling respawn: Will start in 2147483646 seconds
Tue May 25 18:00:36 unknown SpringBoard[24] <Warning>: Application '...' exited abnormally with signal 5: Trace/BPT trap
Tue May 25 18:00:36 unknown ReportCrash[1518] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/..._2010-05-25-180034_...-iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Tue May 25 18:01:36 unknown SpringBoard[24] <Notice>: MultitouchHID(208b30) uilock state: 0 -> 1
正如您所看到的,错误是“未找到符号:_MPMoviePlayerWillEnterFullscreenNotification”。此符号是从iPhone OS 3.2开始在MediaPlayer.framework中提供的通知
那么,我做错了什么?我应该怎样做才能使通用应用程序在OS 3.2(具有新的可用功能)和旧操作系统(具有其功能)上正常工作?
答案 0 :(得分:1)
该常量的内容是字符串@"MPMoviePlayerWillEnterFullscreenNotification"
,因此您可以使用此字符串代替常量。
或者,你可以
dlsym
在运行时获取符号;或答案 1 :(得分:0)
没有添加MediaPlay.framework。