Why does the iOS SDK and iOS version affect each other? Or: What is the iOS SDK?

EDIT:

The answer below from H2CO3 makes me almost happy. But this does not explain one thing: why do I get a run-time exception when building an application against SDK6 (UIPageViewController requires one child controller before adding it to the parent controller), but not when creating against SDK5? Rolf's answer explains what happens: the device knows the SDK that the application was built with and behaves differently to ensure maximum compatibility.

While struggling with iOS SDK versions, MonoTouch versions and different iOS versions, I started to wonder: What is the iOS SDK after ?

I mean, I install Xcode 4.4 and get the iOS SDK 5. If I install Xcode 4.5, I get the SDK for iOS 6. There is still no problem.

  • Now suppose I create an application that targets iOS 5 and does not use any iOS 6 specific things. I am creating this application using iOS SDK 6 .
  • Then I create the same app , but use the iOS SDK 5 .

Then I launch both versions of the application on the iOS 6 device.

Why do they behave differently? There are slight differences, for example, the UIPageViewController throws an exception if the child controller is not installed before the page view controller is added as a child to the parent controller.

As far as I understand, callbacks, functions and everything comes from the iOS operating system, and not from the SDK. But in both cases, the OS is the same.

I fully understand that if I want to use the iOS 6 function, I need to use the iOS SDK 6, because the UICollectionView just does not exist in SDK 5. But the UI code for this view, obviously, is not included in my application, otherwise it will work and on iOS5. Thus, viewing the collection comes from a shared library provided by the OS.

In addition, there is MonoTouch. Assuming that each version of MonoTouch is nothing more than an extension of bindings without error correction, it does not matter which version of MT I use.

A short answer to my question: how will the iOS version, IOS SDK version, MonoTouch version and the target version of the application play together?

+4
source share
2 answers

In theory, you should be able to switch from iOS 5 to iOS 6 SDK and not see the differences. In practice, this is a little different.

  • The device knows the SDK you are using. This means that the device itself may decide to behave differently (for whatever reason, Apple determines that this is a good idea).
  • You use a different toolchain (gcc and related binaries), and they can compile things differently (this is rare, although I have not seen this actually happen).
  • MonoTouch itself can behave differently (nothing comes to mind now, but, for example, we can use different default values ​​for things like the deployment target (if you didn’t do it yourself),

I believe that you are faced with the first case - Apple has added several restrictions for its user interface hierarchy in iOS6, which they apply only if you created against iOS 6 SDK (so as not to violate existing applications, which I suppose) .

+2
source

The iOS SDK consists of two components: a toolchain (Clang and / or GCC as a compiler, ld (64) as a linker and other parts of the cctools package (GNU people call it binutils ) and libraries and header files.

The toolchain version (compiler) is not strictly related to the iOS version number. Theoretically, any sufficient cross-compiler can create code for any iOS (although in practice there are exceptions and limitations that arise due to errors made by Apple when developing its compiler, including the names of hard-coding functions, classes and method selectors, etc. )

The header files and libraries (including library types specific to Apple) are essentially a copy of the /usr/include , /usr/lib and /System/Library/Frameworks directories on iOS. (Even this is not entirely true - in iOS, header files are missing from iOS 3 and libraries from iOS 3.1, since dyld has a common cache ). They mainly tell the compiler and linker which functions, classes, and methods are available for a particular version of iOS. Header files are for checking compile time, and libraries are for checking connection time. Basically, in a regular, non-embedded system (that is, on the desktop), where there is no need to cross-compile the code, β€œSDK” will basically mean the same files in the operating system itself , and it will not be called β€œSDK”; it would rather be called "sysroot".

+5
source

Source: https://habr.com/ru/post/1442703/


All Articles