简体   繁体   English

为应用设置最低iPhone OS版本?

[英]Set minimum iPhone OS version for app?

I'm about to publish an app on the app store, and I'm looking to set the minimum OS version as it appears in iTunes as "Requires iPhone OS 3.x or later". 我即将在应用程序商店发布应用程序,我正在设置将iTunes中显示的最低操作系统版本设置为“需要iPhone OS 3.x或更高版本”。 2 questions: 2个问题:

1) Where do I set this in my Xcode project? 1)我在Xcode项目中将其设置在哪里?

2) I'm aware of the UITableViewCell numberOfLines property that is present only in OS > 3.1. 2)我知道UITableViewCell numberOfLines属性仅存在于OS> 3.1中。 If I set my minimum as OS 3.0, will people who have 3.1 be able to see the number of lines properly as I coded? 如果我将最小值设置为OS 3.0,那么拥有3.1的人是否能够在编码时正确地看到行数? (Obviously people on 3.0 won't be able to) (显然3.0上的人将无法)

Thanks. 谢谢。

What you need to do is change the Deployment Target setting in your project. 您需要做的是更改项目中的“部署目标”设置。 The Deployment Target specifies the minimum OS you would like your application to run on. 部署目标指定您希望应用程序运行的最低操作系统。 This is regardless of the SDK you build against, which should always be the most recent SDK so you can ensure your application runs correctly on the most recent OS version available. 这与您构建的SDK无关,它应始终是最新的SDK,因此您可以确保应用程序在最新的OS版本上正确运行。 So, in short: 简而言之:

  • Set the Base SDK to be the latest OS available 将Base SDK设置为可用的最新OS
  • Set the Deployment Target to be the earliest OS you'd like your app to run on. 将部署目标设置为您希望运行应用程序的最早的操作系统。

To answer your second question, if you set the Deployment Target to 3.0 your 3.1-only code will no longer compile. 要回答第二个问题,如果将部署目标设置为3.0,则不再编译3.1的代码。 There are workarounds to that problem, however. 但是,有一些解决方法可以解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM