1

我有基于 3.0 iPhone OS SDK 的应用程序 任务之一是播放视频(我使用 MPMoviePlayerController 执行此任务)现在我尝试让通用应用程序在 3.0 和 3.2 操作系统上运行我完成了苹果文档中描述的所有步骤:升级当前目标平板电脑;使用运行时检查符号

[[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(具有新的可用功能)和旧操作系统(具有它们的功能)上正常工作?

4

2 回答 2

1

该常量的内容是字符串@"MPMoviePlayerWillEnterFullscreenNotification",因此您可以使用该字符串代替常量。

或者,您可以

  1. 使用诸如dlsym在运行时获取符号之类的功能;或者
  2. 使该符号弱链接(=自动执行步骤1)
于 2010-05-25T17:30:43.977 回答
0

未添加 MediaPlay.framework。

于 2014-09-06T20:06:39.497 回答