代码之家  ›  专栏  ›  技术社区  ›  vodkhang

如何在iPod 3.1.3上运行通用应用程序(iPad和iPhone 4.1)

  •  1
  • vodkhang  · 技术社区  · 14 年前

    我正在为iphone/ipad构建一个通用平台,我已经将部署目标设置为3.0。它可以在ipad 3.2和iphone 4.1上运行良好。但是,当我在iPod 3.1.3上构建和运行它时,运行时会自动选择iPad代码路径,并告诉我它找不到uipopOvercontroller和uimenuitem。在我的iPhone路径代码中,我没有使用类似的东西。

    它成功地构建,只有在尝试运行时,才会显示错误,并且无法找到:

    dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverController
      Referenced from: /var/mobile/Applications/My_APP
      Expected in: /System/Library/Frameworks/UIKit.framework/UIKit
    

    编辑的 :

    如果我移除所有的ipad类并将app.info主NIB包设置为仅iPhone。然后,它工作得很好。我认为问题在于它运行的是iPad代码。我不知道我的iPod或我的项目出了什么问题

    2 回复  |  直到 14 年前
        2
  •  1
  •   Ben    14 年前

    Class infopopclass = NSClassFromString(@"UIPopoverController");
    if(infopopclass) {
        id infopop = [[infopopclass alloc] initWithContentViewController:myPopViewController];
        [infopop presentPopoverFromRect:CGRectMake(20, 70, 10, 10) inView:self.view permittedArrowDirections:4 animated:YES];
    }