您的位置:首页 > 移动开发 > IOS开发

iOS 7弃用了哪些API?

2013-06-14 13:47 316 查看


我们知道苹果在iOS 7 SDK中开放了超过1500个新的API,但我们也知道随着开发技术和设备的进步,有些过时的API是必须废弃掉的,我们来看看苹果在iOS 7中弃用了哪些API。


1.The Map Kit framework includes deprecations for the MKOverlayView class and its various subclasses. The existing overlay views have been replaced with an updated set of overlay renderer objects that descend from theMKOverlayRenderer class. For more information about the classes of this framework, seeMap Kit Framework Reference.


2.The AudioSession API in the Audio Toolbox framework is deprecated. Applications should use the***AudioSession class in the *** Foundation framework instead.

3.TheCLRegion class in the Core Location framework is replaced by the CLCircularRegion class. The CLRegion class continues to exist as an abstract base class that supports both geographic and beacon regions.

4.The UUID property of the CBCentral class is deprecated. To specify the unique ID of your central objects, use the identifier property instead.

5.The Game Kit framework contains assorted deprecations intended to clean up the existing API and provide better support for new features.

6.The UIKit framework contains the following deprecations:

ThewantsFullScreenLayoutproperty of UIViewController is deprecated. In iOS 7 and later, view controllers always support full screen layout.

The UIPopoverController class no longer supports the notion of an arrow direction; it supports a presentation direction.

UIColor objects that provided background textures for earlier versions of iOS are gone.

7.Many drawing additions to the NSString class are deprecated in favor of newer variants.

8.The gethostuuid function in theNSString library is deprecated.

9.In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property of UIDevice instead. (Apps that need an identifier for their own advertising purposes should consider using theadvertisingIdentifier property of ASIdentifierManager instead.)


不过,苹果也不会立刻终结某些API的寿命,会有一个限定时期以方便开发者过渡至新的更好的API。有时,一些API可能是在某些事件暂停使用,做一些更改,而有的API可能会永远远离操作系统了。

作为一个开发者,要尽量避免使用已经弃用的API,至少新代码或者新项目中不能再使用弃用的API,如果现在的代码中使用了弃用的API,要尽可能快地更新你的代码。不过,编译器会在使用弃用API的时候给予提醒。


更多API变更的详细信息可查看:iOS 7.0 API Diffs.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: