为什么iOS SDK和iOS操作系统版本相互影响?或者:什么是iOS SDK? [英] Why do iOS SDK and iOS Operating System version affect each other? Or: What IS an iOS SDK?

查看:121
本文介绍了为什么iOS SDK和iOS操作系统版本相互影响?或者:什么是iOS SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


编辑:

以下来自H2CO3的答案让我快乐。但它没有
解释一件事:为什么在针对SDK6构建
应用程序时会遇到运行时异常(UIPageViewController在将其添加到父控制器之前需要一个子控制器
)但不是在建立反对
SDK5?
Rolf的答案解释了发生了什么:设备知道SDK是一个应用程序是用
构建的,并且行为不同以确保最大兼容性。

The answer below from H2CO3 makes me almost happy. But it does not explain one thing: why do I get a runtime exception when building the app against SDK6 (UIPageViewController requires one child controller before adding it to a parent controller) but not when building against SDK5? The answer from Rolf explains what is going on: the device knows the SDK an app was built with and behaves differently to ensure maximum compatibility.

在与iOS SDK版本,MonoTouch版本和不同的iOS版本抗争时,我开始怀疑:毕竟是什么是iOS SDK

While fighting with iOS SDK versions, MonoTouch versions and different iOS Versions, I started wondering: What IS an iOS SDK after all?

我的意思是,我安装Xcode 4.4并获得iOS SDK 5.如果我安装Xcode 4.5,我会获得iOS SDK 6.到目前为止没问题。

I mean, I install Xcode 4.4 and I get iOS SDK 5. If I install Xcode 4.5, I get iOS SDK 6. So far no problem.


  • 现在假设我构建的应用定位iOS 5 并且不使用任何iOS 6特定的事情。我使用iOS SDK 6构建此应用程序

  • 然后我构建相同的应用程序但使用 iOS SDK 5

  • Now assume I build an app that targets iOS 5 and does not use any iOS 6 specific things. I but build this app using iOS SDK 6.
  • Then I build the same app but use iOS SDK 5.

然后我运行两个版本在iOS 6设备上的应用程序。

Then I run both versions of the app on an iOS 6 device.

为什么它们的行为有所不同?有一些小差异,例如,如果在将页面视图控制器作为子控件添加到父控制器之前没有设置子控制器,则UIPageViewController会抛出异常。

Why do they behave differently? There are small differences, for instance UIPageViewController throws an exception if no child controller is set before adding the page view controller as a child to a parent controller.

据我了解,回调,功能和一切都来自iOS操作系统,而不是来自SDK。但两种情况下操作系统都是相同的。

To my understanding, the callbacks, the features and everything is coming from the iOS Operating System and not from the SDK. But the OS is the same in both cases.

我完全理解如果我想使用iOS 6特定功能,我需要使用iOS SDK 6,因为UICollectionView只是在SDK 5中不存在。但是这个视图的UI代码显然没有包含在我的应用程序中,否则它也适用于iOS5。所以集合视图来自操作系统提供的共享库。

I totally understand that if I want to user an iOS 6 specific feature, I need to use iOS SDK 6 because a UICollectionView just doesn't exist in SDK 5. But the UI code for this view is obviously not getting included in my app, otherwise it would work on iOS5 too. So the collection view is coming from a shared library provided by the OS.

最重要的是MonoTouch。如果我们假设每个MonoTouch版本只是绑定的扩展而不修复任何错误,那么我使用的MT版本无关紧要。

On top of that there is then MonoTouch. If we assume that each MonoTouch version is nothing but an extension of the bindings without fixing any bugs, it should not matter what MT version I use.

我的简短回顾问题是:iOS版本,iOS SDK版本,MonoTouch版本和应用程序的目标版本如何一起玩?

A short recap of my question would be: how do iOS version, iOS SDK version, MonoTouch version and application's target version play together?

推荐答案

理论上,你应该可以从iOS 5切换到iOS 6 SDK,看不出任何差异。在实践中,它是位不同。

In theory, you should be able to switch from the iOS 5 to iOS 6 SDK and not see any differences. In practice it's a little bit different.


  1. 设备知道您使用的SDK。这意味着设备本身可以决定表现不同(无论出于何种原因,Apple认为这是一个好主意)。

  2. 您正在使用不同的工具链(gcc和相关的二进制文件),它们可能会以不同的方式编译(这种情况很少见,我也没有看到它实际发生过)。

  3. MonoTouch本身可能表现不同(现在没有任何想法,但我们可能会使用诸如部署目标之类的东西的不同默认值(如果你当然没有自己设定))。

我相信你在第一种情况下运行 - Apple已经在iOS6中为他们的UI层次结构添加了一些限制,如果您针对iOS 6 SDK进行构建(不打破我认为的现有应用程序),它们只会强制执行。

I believe you're running into the first case - Apple has added a few restrictions to their UI hierarchy in iOS6 which they only enforce if you built against the iOS 6 SDK (to not break existing apps I presume).

这篇关于为什么iOS SDK和iOS操作系统版本相互影响?或者:什么是iOS SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆