iOS 各版本中的新特性(What's New in iOS)

来源:互联网 发布:主力成本线指标源码 编辑:程序博客网 时间:2024/05/22 00:35

  • Introduction

查看文本打印
  1. This document provides information about features that were introduced in different versions of iOS and that affect the development of iOS apps. This document describes only features that affect the development of iOS apps. It does not include user-level features  
  2.  unless there is an aspect of the feature that affects app development. It also does not specifically address minor OS updates that include only bug fixes (and no new features). For additional information about a specific release, you should also see the corresponding  
  3.  release notes.  
  4.   
  5.   
  6.   
  7.   
  8. In addition to describing the new features for each iOS release, this document attempts to provide insight as to how and when you might use those features in your own software. Wherever possible, this document also provides links to other Apple conceptual and  
  9.  reference documentation for that feature. For a complete list of features you can use in your iOS apps, see iOS  
  10.  Technology Overview.  
  11.   
  12.   
  13.   
  14.   
  15. Organization of This Document  
  16.   
  17.   
  18.   
  19. This document includes the following articles:  
查看文本打印
  1. This document provides information about features that were introduced in different versions of iOS and that affect the development of iOS apps. This document describes only features that affect the development of iOS apps. It does not include user-level features  
  2.  unless there is an aspect of the feature that affects app development. It also does not specifically address minor OS updates that include only bug fixes (and no new features). For additional information about a specific release, you should also see the corresponding  
  3.  release notes.  
  4.   
  5.   
  6.   
  7.   
  8. In addition to describing the new features for each iOS release, this document attempts to provide insight as to how and when you might use those features in your own software. Wherever possible, this document also provides links to other Apple conceptual and  
  9.  reference documentation for that feature. For a complete list of features you can use in your iOS apps, see iOS  
  10.  Technology Overview.  
  11.   
  12.   
  13.   
  14.   
  15. Organization of This Document  
  16.   
  17.   
  18.   
  19. This document includes the following articles:  

    • “iOS 6.0”

       describes the new and updated features in iOS 6.0.
    • “iOS 5.1”

       describes the new and updated features in iOS 5.1.
    • “iOS 5.0”

       describes the new and updated features in iOS 5.0.
    • “iOS 4.3”

       describes the new and updated features in iOS 4.3.
    • “iOS 4.2”

       describes the new and updated features in iOS 4.2.
    • “iOS 4.1”

       describes the new and updated features in iOS 4.1.
    • “iOS 4.0”

       describes the new and updated features in iOS 4.0.

Getting the iOS SDK

Development of iOS apps requires an Intel-based Macintosh computer and an up-to-date version of Mac OS X. You must also download and install the iOS SDK. For information about how to get the iOS SDK, go to the iOS Dev Center.

  • iOS 6.0

查看文本打印
  1. This article summarizes the key developer-related features introduced in iOS 6. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features  
  2.  in more detail.  
  3.   
  4.   
  5.   
  6.   
  7. For late-breaking news and information about known issues, see iOS  
  8.  6.0 Release Notes. For the complete list of new APIs added in iOS 6, see iOS  
  9.  6.0 API Diffs.  
  10.   
  11.   
  12.   
  13.   
  14. Maps  
  15.   
  16.   
  17. In addition to the new map tiles provided by Apple, the Maps app and MapKit framework now support additional interactions with other apps. Apps that do not incorporate their own map support now have an easier  
  18.  way to launch the Maps app and display points of interest or directions. Apps that offer routing information, such as turn-by-turn navigation services, can now register as a routing app and make those services available to the entire system.  
  19.   
  20.   
  21.   
  22. Registering as a routing app gives you more opportunities to get your app in front of users. Routing apps are not limited to just driving or walking directions. Routing apps can also include apps that provide  
  23.  directions for the user’s favorite bicycle or hiking trail, for air routes, and for subway or other public transportation lines. And your app does not even have to be installed on the user’s device. Maps knows about routing apps in the App Store and can provide  
  24.  the user with the option to purchase those apps and use them for directions.  
  25.   
  26.   
  27.   
  28. Apps that do not provide routing directions themselves can also take advantage of both Maps and routing apps. Apps can use new interfaces to ask the Maps app to display specific locations or to display routing  
  29.  directions between two locations.  
  30.   
  31.   
  32.   
  33. For information about how to provide directions from your app, or how to use the Maps app to display directions, see Location  
  34.  Awareness Programming Guide.  
  35.   
  36.   
  37.   
  38.   
  39. Social Framework  
  40.   
  41.   
  42. The Social framework (Social.framework) provides a simple interface for accessing the user’s social media accounts. This framework  
  43.  supplants the Twitter framework that was introduced in iOS 5 and adds support for other social accounts, including Facebook and Sina’s Weibo service. Apps can use this framework to post status updates and images to a user’s account. This framework works with  
  44.  the Accounts framework to provide a single sign-on model for the user and to ensure that access to the user’s account is approved.  
  45.   
  46.   
  47.   
  48. The UIKit framework also provides a new UIActivityViewController class  
  49.  for displaying actions that the user might perform on some selected content. One use of this class is to allow the user to post content to social accounts, such as Twitter or Facebook. You present this class modally on iPhone or using a popover controller  
  50.  on iPad. When the user taps one of the buttons, the view controller presents a new interface to perform the associated action.  
  51.   
  52.   
  53.   
  54. For more information about the Social framework, see Social  
  55.  Framework Reference. For information about the UIActivityViewController class, see UIKit  
  56.  Framework Reference.  
  57.   
  58.   
  59.   
  60.   
  61. Pass Kit  
  62.   
  63.   
  64. Pass Kit is a new technology that uses web services, a new file format, and an Objective-C framework (PassKit.framework) to  
  65.  implement support for downloadable passes. Companies can create passes to represent items such as coupons, boarding passes, event tickets, and discount cards for businesses. Instead of carrying a physical representation of these items, users can now store  
  66.  them on their iOS device and use them the same way as before.  
  67.   
  68.   
  69.   
  70. Passes are created by your company’s web service and delivered to the user’s device via email, Safari, or your custom app. The pass itself uses a special file format and is cryptographically signed before being  
  71.  delivered. The file format identifies relevant information about the service being offered so that the user knows what it is for. It might also contain a bar code or other information that you can then use to validate the card so that it can be redeemed or  
  72.  used.  
  73.   
  74.   
  75.   
  76. For more information about Pass Kit and for information how to add support for it into your apps, see Passbook  
  77.  Programming Guide.  
  78.   
  79.   
  80.   
  81.   
  82. Game Center  
  83.   
  84.   
  85. Game Center has been updated and new features have been added to improve the game playing experience. The Game Kit framework (GameKit.framework)  
  86.  includes the following incremental and major changes:  
查看文本打印
  1. This article summarizes the key developer-related features introduced in iOS 6. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features  
  2.  in more detail.  
  3.   
  4.   
  5.   
  6.   
  7. For late-breaking news and information about known issues, see iOS  
  8.  6.0 Release Notes. For the complete list of new APIs added in iOS 6, see iOS  
  9.  6.0 API Diffs.  
  10.   
  11.   
  12.   
  13.   
  14. Maps  
  15.   
  16.   
  17. In addition to the new map tiles provided by Apple, the Maps app and MapKit framework now support additional interactions with other apps. Apps that do not incorporate their own map support now have an easier  
  18.  way to launch the Maps app and display points of interest or directions. Apps that offer routing information, such as turn-by-turn navigation services, can now register as a routing app and make those services available to the entire system.  
  19.   
  20.   
  21.   
  22. Registering as a routing app gives you more opportunities to get your app in front of users. Routing apps are not limited to just driving or walking directions. Routing apps can also include apps that provide  
  23.  directions for the user’s favorite bicycle or hiking trail, for air routes, and for subway or other public transportation lines. And your app does not even have to be installed on the user’s device. Maps knows about routing apps in the App Store and can provide  
  24.  the user with the option to purchase those apps and use them for directions.  
  25.   
  26.   
  27.   
  28. Apps that do not provide routing directions themselves can also take advantage of both Maps and routing apps. Apps can use new interfaces to ask the Maps app to display specific locations or to display routing  
  29.  directions between two locations.  
  30.   
  31.   
  32.   
  33. For information about how to provide directions from your app, or how to use the Maps app to display directions, see Location  
  34.  Awareness Programming Guide.  
  35.   
  36.   
  37.   
  38.   
  39. Social Framework  
  40.   
  41.   
  42. The Social framework (Social.framework) provides a simple interface for accessing the user’s social media accounts. This framework  
  43.  supplants the Twitter framework that was introduced in iOS 5 and adds support for other social accounts, including Facebook and Sina’s Weibo service. Apps can use this framework to post status updates and images to a user’s account. This framework works with  
  44.  the Accounts framework to provide a single sign-on model for the user and to ensure that access to the user’s account is approved.  
  45.   
  46.   
  47.   
  48. The UIKit framework also provides a new UIActivityViewController class  
  49.  for displaying actions that the user might perform on some selected content. One use of this class is to allow the user to post content to social accounts, such as Twitter or Facebook. You present this class modally on iPhone or using a popover controller  
  50.  on iPad. When the user taps one of the buttons, the view controller presents a new interface to perform the associated action.  
  51.   
  52.   
  53.   
  54. For more information about the Social framework, see Social  
  55.  Framework Reference. For information about the UIActivityViewController class, see UIKit  
  56.  Framework Reference.  
  57.   
  58.   
  59.   
  60.   
  61. Pass Kit  
  62.   
  63.   
  64. Pass Kit is a new technology that uses web services, a new file format, and an Objective-C framework (PassKit.framework) to  
  65.  implement support for downloadable passes. Companies can create passes to represent items such as coupons, boarding passes, event tickets, and discount cards for businesses. Instead of carrying a physical representation of these items, users can now store  
  66.  them on their iOS device and use them the same way as before.  
  67.   
  68.   
  69.   
  70. Passes are created by your company’s web service and delivered to the user’s device via email, Safari, or your custom app. The pass itself uses a special file format and is cryptographically signed before being  
  71.  delivered. The file format identifies relevant information about the service being offered so that the user knows what it is for. It might also contain a bar code or other information that you can then use to validate the card so that it can be redeemed or  
  72.  used.  
  73.   
  74.   
  75.   
  76. For more information about Pass Kit and for information how to add support for it into your apps, see Passbook  
  77.  Programming Guide.  
  78.   
  79.   
  80.   
  81.   
  82. Game Center  
  83.   
  84.   
  85. Game Center has been updated and new features have been added to improve the game playing experience. The Game Kit framework (GameKit.framework)  
  86.  includes the following incremental and major changes:  

    • Challenges allow a player to challenge a friend to beat an achievement or score. Players can issue challenges from the Game Center app. You can also use the GKChallengeclass to issue challenges from within your game.

    • The GKGameCenterViewController class incorporates all of the previous capabilities of the leaderboard, achievement and friend request view controllers. You can use the previous view controllers too, but they now present the appropriate tab in the game center view controller.

    • The process for authenticating a local player has changed. In the new process, you set the authenticateHandler property to a block that performs all the authentication steps. Once set, Game Kit automatically authenticates the local player when necessary. However, Game Kit does not display the authentication interface directly. Instead, it lets your handler present the provided authentication view controller, giving you more control over exactly when the authentication user interface appears.

    • The turn-based match class now has support for player timeouts. When using a timeout, you specify a list of players in order. If a player times out, the next player in the list is asked to take a turn instead.

    • The GKMatchmaker class has been updated to include better support for programmatic matchmaking. It is now easier to implement your own user interface for matchmaking on top of Game Center’s built-in support.

    • The GKPlayer class now supports display names for players.

    • The GKMatch class provides a method to estimate which player has the best connection to Game Center. You can use this method when implementing your own client-server architecture on top of the GKMatch infrastructure.

    • The GKAchievement class now allows multiple achievements to be submitted at the same time.

查看文本打印
  1. For more information about how to use Game Center in your app, see Game  
  2.  Center Programming Guide.  
  3.   
  4.   
  5.   
  6.   
  7. Reminders  
  8.   
  9.   
  10. The Event Kit framework now includes interfaces for creating and accessing reminders on the user’s device. The reminders you create show up in the Reminders app along with ones created by the user. Reminders  
  11.  can include proximity or time-based alarms.  
  12.   
  13.   
  14.   
  15. For more information about the interfaces of the Event Kit framework, including the new interfaces for creating reminders, see Event  
  16.  Kit Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. In-App Purchase  
  22.   
  23.   
  24. The Store Kit framework (StoreKit.framework) now supports the purchasing of iTunes content inside your app and provides support  
  25.  for having downloadable content hosted on Apple servers. With in-app content purchases, you present a view controller that lets users purchase apps, music, books, and other iTunes content directly from within your app. You identify the items you want to make  
  26.  available for purchase but the rest of the transaction is handled for you by Store Kit.  
  27.   
  28.   
  29.   
  30. Prior to iOS 6, you were responsible for managing any downloadable content made available through in app purchase. Hosted downloads now simplify the work you need to do to make content available to users. The  
  31.  new SKDownload class  
  32.  represents a downloadable piece of content. In addition, the SKPaymentTransaction class  
  33.  has been modified to provide an array of download objects for any hosted content. To download a piece of content, you queue a download object on the payment queue. When the download completes, your payment queue observer is notified.  
  34.   
  35.   
  36.   
  37. For more information about the classes of the Store Kit framework, see Store  
  38.  Kit Framework Reference.  
  39.   
  40.   
  41.   
  42.   
  43. Collection Views  
  44.   
  45.   
  46. The UICollectionView class  
  47.  offers a new way to present ordered data to users. With a collection view object, you are now able to define the presentation and arrangement of embedded views. The collection view class works closely with an accompanying layout object to define the placement  
  48.  of individual data items. UIKit provides a standard flow-based layout object that you can use to implement multi-column grids containing items of standard or varying sizes. And if you want to go beyond grid layouts, you can create your own custom layout objects  
  49.  to support any layout style you choose.  
  50.   
  51.   
  52.   
  53. Collection views work with a dedicated group of classes to support the display of items. In addition to cells, collection views can have supplementary views and decoration views. The usage and placement of these  
  54.  views is controlled entirely by the layout object. For example, the flow-based layout object uses supplementary views to implement header and footer views for sections in the collection view.  
  55.   
  56.   
  57.   
  58. Other noteworthy features of collection views include:  
查看文本打印
  1. For more information about how to use Game Center in your app, see Game  
  2.  Center Programming Guide.  
  3.   
  4.   
  5.   
  6.   
  7. Reminders  
  8.   
  9.   
  10. The Event Kit framework now includes interfaces for creating and accessing reminders on the user’s device. The reminders you create show up in the Reminders app along with ones created by the user. Reminders  
  11.  can include proximity or time-based alarms.  
  12.   
  13.   
  14.   
  15. For more information about the interfaces of the Event Kit framework, including the new interfaces for creating reminders, see Event  
  16.  Kit Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. In-App Purchase  
  22.   
  23.   
  24. The Store Kit framework (StoreKit.framework) now supports the purchasing of iTunes content inside your app and provides support  
  25.  for having downloadable content hosted on Apple servers. With in-app content purchases, you present a view controller that lets users purchase apps, music, books, and other iTunes content directly from within your app. You identify the items you want to make  
  26.  available for purchase but the rest of the transaction is handled for you by Store Kit.  
  27.   
  28.   
  29.   
  30. Prior to iOS 6, you were responsible for managing any downloadable content made available through in app purchase. Hosted downloads now simplify the work you need to do to make content available to users. The  
  31.  new SKDownload class  
  32.  represents a downloadable piece of content. In addition, the SKPaymentTransaction class  
  33.  has been modified to provide an array of download objects for any hosted content. To download a piece of content, you queue a download object on the payment queue. When the download completes, your payment queue observer is notified.  
  34.   
  35.   
  36.   
  37. For more information about the classes of the Store Kit framework, see Store  
  38.  Kit Framework Reference.  
  39.   
  40.   
  41.   
  42.   
  43. Collection Views  
  44.   
  45.   
  46. The UICollectionView class  
  47.  offers a new way to present ordered data to users. With a collection view object, you are now able to define the presentation and arrangement of embedded views. The collection view class works closely with an accompanying layout object to define the placement  
  48.  of individual data items. UIKit provides a standard flow-based layout object that you can use to implement multi-column grids containing items of standard or varying sizes. And if you want to go beyond grid layouts, you can create your own custom layout objects  
  49.  to support any layout style you choose.  
  50.   
  51.   
  52.   
  53. Collection views work with a dedicated group of classes to support the display of items. In addition to cells, collection views can have supplementary views and decoration views. The usage and placement of these  
  54.  views is controlled entirely by the layout object. For example, the flow-based layout object uses supplementary views to implement header and footer views for sections in the collection view.  
  55.   
  56.   
  57.   
  58. Other noteworthy features of collection views include:  

    • UICollectionViewController class for managing the presentation of collection views in your app

    • Support for animating content within the collection view

    • Batch support for inserting, moving, and deleting items

    • A simplified model for creating and managing cells and other views

查看文本打印
  1. For more information about using collection views to implement your user interface, see Collection  
  2.  View Programming Guide for iOS.  
  3.   
  4.   
  5.   
  6.   
  7. UI State Preservation  
  8.   
  9.   
  10. State preservation makes it easier for apps to restore their user interface to the state it was in when the user last used it. Prior to iOS 6, apps were encouraged to write out information about their current  
  11.  interface state in the event that the app was terminated. Upon relaunch, the app could use this state to restore its interface and make it seem as if the app had never quit. State preservation simplifies this process by providing you with all of the core infrastructure  
  12.  for saving and restoring your app’s interface.  
  13.   
  14.   
  15.   
  16. Implementing state preservation still requires effort on your part to identify what parts of your interface to save. In addition, the preservation and restoration processes can be customized to accommodate unforeseen  
  17.  circumstances, such as missing content during a subsequent relaunch or changes to your app’s UI.  
  18.   
  19.   
  20.   
  21. For more information about how to add state preservation support to your app, see iOS  
  22.  App Programming Guide.  
  23.   
  24.   
  25.   
  26.   
  27. Auto Layout  
  28.   
  29.   
  30. Auto layout improves upon the “springs and struts” model previously used to lay out the elements of a user interface. With auto layout, you define rules for how to lay out the elements in your user interface.  
  31.  These rules express a larger class of relationships and are more intuitive to use than springs and struts.  
  32.   
  33.   
  34.   
  35. The entities used in Auto Layout are Objective-C objects called constraints. This approach brings you a number of benefits:  
查看文本打印
  1. For more information about using collection views to implement your user interface, see Collection  
  2.  View Programming Guide for iOS.  
  3.   
  4.   
  5.   
  6.   
  7. UI State Preservation  
  8.   
  9.   
  10. State preservation makes it easier for apps to restore their user interface to the state it was in when the user last used it. Prior to iOS 6, apps were encouraged to write out information about their current  
  11.  interface state in the event that the app was terminated. Upon relaunch, the app could use this state to restore its interface and make it seem as if the app had never quit. State preservation simplifies this process by providing you with all of the core infrastructure  
  12.  for saving and restoring your app’s interface.  
  13.   
  14.   
  15.   
  16. Implementing state preservation still requires effort on your part to identify what parts of your interface to save. In addition, the preservation and restoration processes can be customized to accommodate unforeseen  
  17.  circumstances, such as missing content during a subsequent relaunch or changes to your app’s UI.  
  18.   
  19.   
  20.   
  21. For more information about how to add state preservation support to your app, see iOS  
  22.  App Programming Guide.  
  23.   
  24.   
  25.   
  26.   
  27. Auto Layout  
  28.   
  29.   
  30. Auto layout improves upon the “springs and struts” model previously used to lay out the elements of a user interface. With auto layout, you define rules for how to lay out the elements in your user interface.  
  31.  These rules express a larger class of relationships and are more intuitive to use than springs and struts.  
  32.   
  33.   
  34.   
  35. The entities used in Auto Layout are Objective-C objects called constraints. This approach brings you a number of benefits:  

    • Localization through swapping of strings alone, instead of also revamping layouts.

    • Mirroring of user-interface elements for right-to-left languages like Hebrew and Arabic.

    • Better layering of responsibility between objects in the view and controller layers.

A view object usually knows best about its standard size and its positioning within its superview and relative to its sibling views. A controller can override these values if something nonstandard is required.

For more information about using auto layout, see Cocoa Auto Layout Guide.

Data Privacy

In addition to location data, the system now asks the user’s permission before allowing third-party apps to access certain user data, including:

    • Contacts

    • Calendars

    • Reminders

    • Photo Library

查看文本打印
  1. For contact, calendar, and reminder data, your app needs to be prepared to be denied access to these items and to adjust its behavior accordingly. If the user has not yet been prompted to allow access, the returned  
  2.  structure is valid but contains no records. If the user has denied access, the app receives a NULL value or no data. If the user grants permission to the app, the system subsequently  
  3.  notifies the app that it needs to reload or revert the data.  
  4.   
  5.   
  6.   
  7. For the photo library, the existing interface supports the app being denied access.  
  8.   
  9.   
  10.   
  11. Your app can provide a description for how it intends to use the data in its Info.plist file. That data is then displayed to  
  12.  the user when the system needs to prompt for access. For more information about the keys you need to add to your Info.plist file, see Information  
  13.  Property List Key Reference. For more information about accessing specific kinds of data, see the respective framework reference.  
  14.   
  15.   
  16.   
  17.   
  18. Additional Framework Enhancements  
  19.   
  20.   
  21. In addition to the items discussed in the preceding sections, the following frameworks have additional enhancements. For a complete list of new interfaces, see iOS  
  22.  6.0 API Diffs.  
  23.   
  24.   
  25.   
  26.   
  27. UIKit Framework  
  28.   
  29.   
  30. The UIKit framework (UIKit.framework)includes the following enhancements:  
查看文本打印
  1. For contact, calendar, and reminder data, your app needs to be prepared to be denied access to these items and to adjust its behavior accordingly. If the user has not yet been prompted to allow access, the returned  
  2.  structure is valid but contains no records. If the user has denied access, the app receives a NULL value or no data. If the user grants permission to the app, the system subsequently  
  3.  notifies the app that it needs to reload or revert the data.  
  4.   
  5.   
  6.   
  7. For the photo library, the existing interface supports the app being denied access.  
  8.   
  9.   
  10.   
  11. Your app can provide a description for how it intends to use the data in its Info.plist file. That data is then displayed to  
  12.  the user when the system needs to prompt for access. For more information about the keys you need to add to your Info.plist file, see Information  
  13.  Property List Key Reference. For more information about accessing specific kinds of data, see the respective framework reference.  
  14.   
  15.   
  16.   
  17.   
  18. Additional Framework Enhancements  
  19.   
  20.   
  21. In addition to the items discussed in the preceding sections, the following frameworks have additional enhancements. For a complete list of new interfaces, see iOS  
  22.  6.0 API Diffs.  
  23.   
  24.   
  25.   
  26.   
  27. UIKit Framework  
  28.   
  29.   
  30. The UIKit framework (UIKit.framework)includes the following enhancements:  

    • UIKit now supports state preservation for your app’s user interface; see “UI State Preservation.”

    • Views now support constraint-based layout; see “Auto Layout.”

    • The UICollectionView class (and its supporting classes and protocols) support the presentation of ordered collections of items; see “Collection Views.”

    • UITextView

       and UITextField now support styled text using attributed strings.
    • UIKit now includes support for drawing NSAttributedString and NSMutableAttributedString objects. In addition, string-based views now support attributed strings for content.

    • Accessibility support has been improved to include new VoiceOver enhancements:

      • VoiceOver can now use gestures to trigger specific actions.

      • Developers can order items together in the element list that VoiceOver creates to provide a more logical flow from element to element.

      • Scroll views can now provide a special status string during scrolling.

      • You can now post notifications that let the accessibility system know your app’s layout or UI have changed.

      • New notifications provide information about the state of VoiceOver announcements.

    • The UIActivityViewController class adds support for sharing content via services like email, Twitter, and Facebook; see also, “Social Framework.”

    • The UIDevice class adds a vendor-specific identifier.

    • The UIImage class includes new initialization methods for specifying the scale factor of an image.

    • Appearance customization support has been added to the UIBarButtonItemUIPageControlUIPageViewControllerUISwitch, and UIStepper classes.

    • The UITableView class includes the following changes:

      • Support for a new UITableViewHeaderFooterView class implements the table’s headers and footers

      • A simplified model for creating and managing cells and other views.

    • The UITableViewController class allows you to add a built-in refresh control (UIRefreshControl) to reload the table contents.

    • Storyboards allow you to unwind segues and specify restoration identifiers.

    • The UIWebView class provides a way to disable the incremental rendering of web content.

    • The UIViewController class has new interfaces supporting the following behaviors:

      • New interfaces provide a clearer path for managing and tracking interface rotations.

      • You can prevent a segue from being triggered.

      • Support has been added for unwinding segues.

    • You can now subclass UINavigationBar and incorporate your custom navigation bar into your app’s navigation interfaces.

For information about the classes of the UIKit framework, see UIKit Framework Reference.

OpenGL ES

OpenGL ES includes the following new extensions:

    • The GL_EXT_texture_storage extension allows your app to specify the entire structure of a texture in a single call, allowing your textures to be optimized further by OpenGL ES.

    • The GL_APPLE_copy_texture_levels extension builds on top of the functionality of the GL_EXT_texture_storage extension and allows a set of texture mipmaps to be copied from one texture to another.

    • The GL_EXT_map_buffer_range extension improves performance when you only need to modify a subset of a buffer object.

    • The GL_APPLE_sync extension provides fine-grain synchronization to your app. It allows you to choose a subset of submitted OpenGL ES commands and block until those commands complete.

    • The GL_EXT_shader_framebuffer_fetch extension is only available to OpenGL ES 2.0 applications and provides access to the framebuffer data as an input to your fragment shader.

查看文本打印
  1. These extensions are available on all devices capable of running iOS 6. As always, check for the existence of an extension before using it in your application.  
  2.   
  3.   
  4.   
  5.   
  6. Media Player Framework  
  7.   
  8.   
  9. The MPVolumeView class  
  10.  now provides interfaces for customizing the appearance of the volume view. You can use these interfaces to change the images associated with the volume slider and routing button.  
  11.   
  12.   
  13.   
  14. For information about the classes of the Media Player framework, see Media  
  15.  Player Framework Reference.  
  16.   
  17.   
  18.   
  19.   
  20. Image IO Framework  
  21.   
  22.   
  23. The Image IO framework (ImageIO.framework) includes support for accessing EXIF and IPTC metadata properties for images. You  
  24.  can access this metadata using functions associated with the CGImageSourceRef and CGImageDestinationRef opaque  
  25.  types.  
  26.   
  27.   
  28.   
  29. For information about the classes of the Image IO framework, see Image  
  30.  I/O Reference Collection.  
  31.   
  32.   
  33.   
  34.   
  35. iAd Framework  
  36.   
  37.   
  38. The iAd framework (iAd.framework) supports a new medium rectangle banner size for ads on iPad devices. For information about  
  39.  the classes of the iAd framework, see iAd  
  40.  Framework Reference.  
  41.   
  42.   
  43.   
  44.   
  45. Foundation Framework  
  46.   
  47.   
  48. The Foundation framework (Foundation.framework) includes the following enhancements:  
查看文本打印
  1. These extensions are available on all devices capable of running iOS 6. As always, check for the existence of an extension before using it in your application.  
  2.   
  3.   
  4.   
  5.   
  6. Media Player Framework  
  7.   
  8.   
  9. The MPVolumeView class  
  10.  now provides interfaces for customizing the appearance of the volume view. You can use these interfaces to change the images associated with the volume slider and routing button.  
  11.   
  12.   
  13.   
  14. For information about the classes of the Media Player framework, see Media  
  15.  Player Framework Reference.  
  16.   
  17.   
  18.   
  19.   
  20. Image IO Framework  
  21.   
  22.   
  23. The Image IO framework (ImageIO.framework) includes support for accessing EXIF and IPTC metadata properties for images. You  
  24.  can access this metadata using functions associated with the CGImageSourceRef and CGImageDestinationRef opaque  
  25.  types.  
  26.   
  27.   
  28.   
  29. For information about the classes of the Image IO framework, see Image  
  30.  I/O Reference Collection.  
  31.   
  32.   
  33.   
  34.   
  35. iAd Framework  
  36.   
  37.   
  38. The iAd framework (iAd.framework) supports a new medium rectangle banner size for ads on iPad devices. For information about  
  39.  the classes of the iAd framework, see iAd  
  40.  Framework Reference.  
  41.   
  42.   
  43.   
  44.   
  45. Foundation Framework  
  46.   
  47.   
  48. The Foundation framework (Foundation.framework) includes the following enhancements:  

    • The NSFileManager class includes the ubiquityIdentityToken method for determining the availability of iCloud, and the NSUbiquityIdentityDidChangeNotificationnotification for responding to a user logging into or out of iCloud, or changing accounts.

    • The NSUUID class helps you create objects that represent various types of UUIDs (Universally Unique Identifiers). For example, you can create an NSUUID object with RFC 4122 version 4 random bytes, or you can base it on an existing UUID string.

    • The NSURLRequest class lets you specify whether a request should be allowed to happen over a cellular network.

    • The NSString class has new methods for converting a string to uppercase, lowercase, or an initial capital case.

查看文本打印
  1. For information about the classes of the Foundation framework, see Foundation  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. External Accessory Framework  
  8.   
  9.   
  10. The External Accessory framework (ExternalAccessory.framework) includes new interfaces for managing connections to Bluetooth  
  11.  devices. Apps can now post an alert panel that lists the Bluetooth devices available for pairing. Support is also provided for waking previously paired accessories that do not automatically connect.  
  12.   
  13.   
  14.   
  15. For information about the classes of the External Accessory framework, see External  
  16.  Accessory Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. Event Kit Framework  
  22.   
  23.   
  24. The Event Kit framework (EventKit.framework) includes the following enhancements:  
查看文本打印
  1. For information about the classes of the Foundation framework, see Foundation  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. External Accessory Framework  
  8.   
  9.   
  10. The External Accessory framework (ExternalAccessory.framework) includes new interfaces for managing connections to Bluetooth  
  11.  devices. Apps can now post an alert panel that lists the Bluetooth devices available for pairing. Support is also provided for waking previously paired accessories that do not automatically connect.  
  12.   
  13.   
  14.   
  15. For information about the classes of the External Accessory framework, see External  
  16.  Accessory Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. Event Kit Framework  
  22.   
  23.   
  24. The Event Kit framework (EventKit.framework) includes the following enhancements:  

    • The framework supports the creation of reminders; see “Reminders.”

    • Calendar and reminder events can now vend an external identifier that lets multiple devices refer to the same event on the server. The server provides the actual identifier string, which is accessed using the calendarItemExternalIdentifier property of EKCalendarItem.

    • For apps linked against iOS 6 and later, the system asks for the user’s permission before granting access to calendar and reminder data.

    • Apps can now cancel editing programmatically from an EKEventEditViewController object.

查看文本打印
  1. For information about the classes of the Event Kit framework, see Calendar  
  2.  and Reminders Programming Guide.  
  3.   
  4.   
  5.   
  6.   
  7. Core Video Framework  
  8.   
  9.   
  10. The Core Video framework (CoreVideo.framework) adds support for two new pixel formats. These formats provide efficient storage  
  11.  for one-channel and two-channel images that interoperate with OpenGL ES. For information about the functions of the Core Video framework, see Core  
  12.  Video Framework Reference.  
  13.   
  14.   
  15.   
  16.   
  17. Core Media Framework  
  18.   
  19.   
  20. The Core Media framework (CoreMedia.framework) adds the CMClockRef and CMTimebaseRef types,  
  21.  which define fundamental media time service behaviors. For information about the functions of the Core Media framework, see Core  
  22.  Media Framework Reference.  
  23.   
  24.   
  25.   
  26.   
  27. Core Location Framework  
  28.   
  29.   
  30. The Core Location framework (CoreLocation.framework) includes the following changes.  
查看文本打印
  1. For information about the classes of the Event Kit framework, see Calendar  
  2.  and Reminders Programming Guide.  
  3.   
  4.   
  5.   
  6.   
  7. Core Video Framework  
  8.   
  9.   
  10. The Core Video framework (CoreVideo.framework) adds support for two new pixel formats. These formats provide efficient storage  
  11.  for one-channel and two-channel images that interoperate with OpenGL ES. For information about the functions of the Core Video framework, see Core  
  12.  Video Framework Reference.  
  13.   
  14.   
  15.   
  16.   
  17. Core Media Framework  
  18.   
  19.   
  20. The Core Media framework (CoreMedia.framework) adds the CMClockRef and CMTimebaseRef types,  
  21.  which define fundamental media time service behaviors. For information about the functions of the Core Media framework, see Core  
  22.  Media Framework Reference.  
  23.   
  24.   
  25.   
  26.   
  27. Core Location Framework  
  28.   
  29.   
  30. The Core Location framework (CoreLocation.framework) includes the following changes.  

    • The CLLocationManager object now pauses the delivery of location events when the user has not moved for an extended period of time. This behavior saves power by allowing the framework to turn off the GPS and other hardware. It is enabled by default but may be disabled by changing the value in the pausesLocationUpdatesAutomaticallyproperty of the location manager object.

    • You can refine location accuracy based on usage by assigning an appropriate value to the activityType property of CLLocationManager. This property currently lets you distinguish between driving usage and fitness usage.

    • The framework supports improved location accuracy while offline and driving.

查看文本打印
  1. For information about the classes of the Core Location framework, see Core  
  2.  Location Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Core Bluetooth Framework  
  8.   
  9.   
  10. The Core Bluetooth framework (CoreBluetooth.framework) supports interacting with Bluetooth devices in peripheral mode. Previously,  
  11.  an iOS device could only interact in central mode but it can advertise itself in peripheral mode and communicate with other iOS devices.  
  12.   
  13.   
  14.   
  15. For information about the classes of the Core Bluetooth framework, see Core  
  16.  Bluetooth Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. Core Audio  
  22.   
  23.   
  24. Core Audio family of frameworks includes the following changes:  
查看文本打印
  1. For information about the classes of the Core Location framework, see Core  
  2.  Location Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Core Bluetooth Framework  
  8.   
  9.   
  10. The Core Bluetooth framework (CoreBluetooth.framework) supports interacting with Bluetooth devices in peripheral mode. Previously,  
  11.  an iOS device could only interact in central mode but it can advertise itself in peripheral mode and communicate with other iOS devices.  
  12.   
  13.   
  14.   
  15. For information about the classes of the Core Bluetooth framework, see Core  
  16.  Bluetooth Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. Core Audio  
  22.   
  23.   
  24. Core Audio family of frameworks includes the following changes:  

    • There is a new AUDeferredRenderer audio unit that allows audio to be processed on a lower-priority thread using relatively larger time slices.

    • The AudioQueueProcessingTap audio unit allows you to intercept the data in an audio queue and process it.

For information about the audio technologies available in iOS, see Multimedia Programming Guide. For information about the new audio units, see Audio Unit Component Services Reference.

AV Foundation Framework

The AV Foundation framework (AVFoundation.framework) includes the following enhancements:

    • The AVPlayer class adds support for syncing playback to an external time source. A single player object can also play both HTTP Live Streams and file-based assets (including both local files and files that are progressively downloaded). And you can use multiple AVPlayerLayer objects to display the visual output of the same player object.

    • The new AVPlayerItemOutput class works with an AVPlayerItem object to obtain decoded video frames during playback so that your app can process them.

    • The AVAssetResourceLoader class allows you to insert a delegate object into the asset loading process and handle custom resource requests. This class works with theAVURLAsset class.

    • The AVAudioSession class now exposes information about the current audio route in use.

    • The AVAudioMixInputParameters class provides access to an MTAudioProcessingTapRef data type, which can be used to access audio data before it is played, read, or exported.

    • The AVAudioSession class includes the following enhancements:

      • Use of an audio session delegate to detect interruptions and changes is now deprecated in favor of a set of new notifications.

      • Audio sessions support a new audio category, AVAudioSessionCategoryMultiRoute, that allows routing of audio to and from multiple audio hardware devices.

      • Audio sessions support a new mode, AVAudioSessionModeMoviePlayback, that engages appropriate output signal processing for movie playback scenarios.

    • The AVCaptureConnection class allows you to enable or disable support for video stabilization on incoming video.

    • The AVCaptureMetadataOutput class is a new class for intercepting metadata emitted by a capture connection object.

    • The AVMetadataFaceObject is a new class that reports the face-detection data captured by an AVCaptureMetadataOutput object.

    • The AVTextStyleRule class is a new class for specifying style options for subtitles, closed captions, and other text-related media assets.

    • The AVAudioPlayer class can play audio items from the user’s iPod library using URLs obtained from the MPMediaLibrary class. You can also set channel assignments using the channelAssignments property.

查看文本打印
  1. For information about the classes of the AV Foundation framework, see AV  
  2.  Foundation Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Ad Support Framework  
  8.   
  9.   
  10. The Ad Support framework (AdSupport.framework) is a new framework that provides access to an identifier that apps can use for  
  11.  advertising purposes. This framework also provides a flag that indicates whether the user has opted out of ad tracking. Apps are required to read and honor the opt-out flag before trying to access the advertising identifier.  
  12.   
  13.   
  14.   
  15. For more information about this framework, see Ad  
  16.  Support Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. Accelerate Framework  
  22.   
  23.   
  24. The Accelerate framework (Accelerate.framework) includes new vector-scalar power functions, vDSP functions, discrete cosine  
  25.  transform functions, SSE-related vector functions, sine functions, and vImage functions.  
  26.   
  27.   
  28.   
  29. For information about the functions of the Accelerate framework, see Accelerate  
  30.  Framework Reference.  
查看文本打印
  1. For information about the classes of the AV Foundation framework, see AV  
  2.  Foundation Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Ad Support Framework  
  8.   
  9.   
  10. The Ad Support framework (AdSupport.framework) is a new framework that provides access to an identifier that apps can use for  
  11.  advertising purposes. This framework also provides a flag that indicates whether the user has opted out of ad tracking. Apps are required to read and honor the opt-out flag before trying to access the advertising identifier.  
  12.   
  13.   
  14.   
  15. For more information about this framework, see Ad  
  16.  Support Framework Reference.  
  17.   
  18.   
  19.   
  20.   
  21. Accelerate Framework  
  22.   
  23.   
  24. The Accelerate framework (Accelerate.framework) includes new vector-scalar power functions, vDSP functions, discrete cosine  
  25.  transform functions, SSE-related vector functions, sine functions, and vImage functions.  
  26.   
  27.   
  28.   
  29. For information about the functions of the Accelerate framework, see Accelerate  
  30.  Framework Reference.  

  • iOS 5.1

查看文本打印
  1. This article summarizes the key developer-related features introduced in iOS 5.1. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features  
  2.  in more detail.  
  3.   
  4.   
  5.   
  6.   
  7. For late-breaking news and information about known issues, see iOS  
  8.  5.1 Release Notes. For the complete list of new APIs added in iOS 5.1, see iOS  
  9.  5.1 API Diffs.  
  10.   
  11.   
  12.   
  13.   
  14. Dictation Support in Text Input Views  
  15.   
  16.   
  17. On supported devices, iOS automatically inserts recognized phrases into the current text view when the user has chosen dictation input. The new UIDictationPhrase class  
  18.  (declared in UITextInput.h) provides you with a string representing a phrase that a user has dictated. In the case of ambiguous dictation results, the new class provides an  
  19.  array containing alternative strings. New methods in the UITextInput protocol allow your app to respond to the completion of dictation.  
查看文本打印
  1. This article summarizes the key developer-related features introduced in iOS 5.1. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features  
  2.  in more detail.  
  3.   
  4.   
  5.   
  6.   
  7. For late-breaking news and information about known issues, see iOS  
  8.  5.1 Release Notes. For the complete list of new APIs added in iOS 5.1, see iOS  
  9.  5.1 API Diffs.  
  10.   
  11.   
  12.   
  13.   
  14. Dictation Support in Text Input Views  
  15.   
  16.   
  17. On supported devices, iOS automatically inserts recognized phrases into the current text view when the user has chosen dictation input. The new UIDictationPhrase class  
  18.  (declared in UITextInput.h) provides you with a string representing a phrase that a user has dictated. In the case of ambiguous dictation results, the new class provides an  
  19.  array containing alternative strings. New methods in the UITextInput protocol allow your app to respond to the completion of dictation.  

  • iOS 5.0

查看文本打印
  1. This article summarizes the key developer-related features introduced in iOS 5.0. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features  
  2.  in more detail.  
  3.   
  4.   
  5.   
  6.   
  7. For late-breaking news and information about known issues, see iOS  
  8.  5.0 Release Notes. For the complete list of new APIs added in iOS 5.0, see iOS  
  9.  5.0 API Diffs.  
  10.   
  11.   
  12.   
  13.   
  14. iCloud Storage APIs  
  15.   
  16.   
  17. The iCloud storage APIs let your app write user documents and data to a central location and access those items from all of a user’s computers and iOS devices. Making a user’s documents ubiquitous using iCloud  
  18.  means that a user can view or edit those documents from any device without having to sync or transfer files explicitly. Storing documents in a user’s iCloud account also provides a layer of security for that user. Even if a user loses a device, the documents  
  19.  on that device are not lost if they are in iCloud storage.  
  20.   
  21.   
  22.   
  23. There are two ways that apps can take advantage of iCloud storage, each of which has a different intended usage  
查看文本打印
  1. This article summarizes the key developer-related features introduced in iOS 5.0. This version of the operating system runs on current iOS-based devices. In addition to describing the key new features, this article lists the documents that describe those features  
  2.  in more detail.  
  3.   
  4.   
  5.   
  6.   
  7. For late-breaking news and information about known issues, see iOS  
  8.  5.0 Release Notes. For the complete list of new APIs added in iOS 5.0, see iOS  
  9.  5.0 API Diffs.  
  10.   
  11.   
  12.   
  13.   
  14. iCloud Storage APIs  
  15.   
  16.   
  17. The iCloud storage APIs let your app write user documents and data to a central location and access those items from all of a user’s computers and iOS devices. Making a user’s documents ubiquitous using iCloud  
  18.  means that a user can view or edit those documents from any device without having to sync or transfer files explicitly. Storing documents in a user’s iCloud account also provides a layer of security for that user. Even if a user loses a device, the documents  
  19.  on that device are not lost if they are in iCloud storage.  
  20.   
  21.   
  22.   
  23. There are two ways that apps can take advantage of iCloud storage, each of which has a different intended usage  

    • iCloud document storage

      —Use this feature to store user documents and data in the user’s iCloud account.
    • iCloud key-value data storage

      —Use this feature to share small amounts of data among instances of your app.

查看文本打印
  1. Most apps will use iCloud document storage to share documents from a user’s iCloud account. This is the feature that users think of when they think of iCloud storage. A user cares about whether documents are  
  2.  shared across devices and can see and manage those documents from a given device. In contrast, the iCloud key-value data store is not something a user would see. It is a way for your app to share small amounts of data (up to a per-app total of 1 MB and a maximum  
  3.  of 1,024 keys) with other instances of itself. Apps can use this feature to store important state information. A magazine app might save the issue and page that the user read last, while a stocks app might store the stock symbols the user is tracking.  
  4.   
  5.   
  6.   
  7. For information on how to use iCloud document and key-value data storage, see iCloud  
  8.  Design Guide.  
  9.   
  10.   
  11.   
  12.   
  13. iCloud Backup  
  14.   
  15.   
  16. Users can now opt to have their apps and app data backed up directly to their iCloud account, making it easier to restore apps to their most recent state. Having data backed up in iCloud makes it easy for a user  
  17.  to reinstall that data to a new or existing iOS device. However, because the amount of space in a user’s iCloud account is limited, apps must be even more selective about where they store files.  
  18.   
  19.   
  20.   
  21. The placement of files in your app’s home directory determines what gets backed up and what does not. Anything that would be backed up to a user’s computer is also backed up wirelessly to iCloud. Thus, everything  
  22.  in the Documents directory and most (but not all) of your app’s Library directory. To minimize  
  23.  the amount of data stored in the user’s iCloud account, developers are encouraged to put more files in the Library/Caches directory, especially if those files can be easily  
  24.  re-created or obtained in another way.  
  25.   
  26.   
  27. Note: Any documents  
  28.  that your app stores explicitly in iCloud (using the iCloud storage APIs) are not backed up with your app. (Those documents are already stored in the user’s iCloud account and therefore do not need to be backed up separately.)  
  29.   
  30. For information on which directories are backed up, and for information about iCloud document storage, see iOS  
  31.  App Programming Guide.  
  32.   
  33.   
  34.   
  35.   
  36. Automatic Reference Counting  
  37.   
  38.   
  39. Automatic Reference Counting (ARC)  
  40.   
  41. is a compiler-level feature that simplifies the process of managing the lifetimes of Objective-C objects. Instead of you having to remember when to retain or release an object, ARC evaluates the lifetime requirements of your objects and automatically  
  42.  inserts the appropriate method calls at compile time.  
  43.   
  44.   
  45. To be able to deliver these features, ARC imposes some restrictions—primarily enforcing some best practices and disallowing some other practices:  
查看文本打印
  1. Most apps will use iCloud document storage to share documents from a user’s iCloud account. This is the feature that users think of when they think of iCloud storage. A user cares about whether documents are  
  2.  shared across devices and can see and manage those documents from a given device. In contrast, the iCloud key-value data store is not something a user would see. It is a way for your app to share small amounts of data (up to a per-app total of 1 MB and a maximum  
  3.  of 1,024 keys) with other instances of itself. Apps can use this feature to store important state information. A magazine app might save the issue and page that the user read last, while a stocks app might store the stock symbols the user is tracking.  
  4.   
  5.   
  6.   
  7. For information on how to use iCloud document and key-value data storage, see iCloud  
  8.  Design Guide.  
  9.   
  10.   
  11.   
  12.   
  13. iCloud Backup  
  14.   
  15.   
  16. Users can now opt to have their apps and app data backed up directly to their iCloud account, making it easier to restore apps to their most recent state. Having data backed up in iCloud makes it easy for a user  
  17.  to reinstall that data to a new or existing iOS device. However, because the amount of space in a user’s iCloud account is limited, apps must be even more selective about where they store files.  
  18.   
  19.   
  20.   
  21. The placement of files in your app’s home directory determines what gets backed up and what does not. Anything that would be backed up to a user’s computer is also backed up wirelessly to iCloud. Thus, everything  
  22.  in the Documents directory and most (but not all) of your app’s Library directory. To minimize  
  23.  the amount of data stored in the user’s iCloud account, developers are encouraged to put more files in the Library/Caches directory, especially if those files can be easily  
  24.  re-created or obtained in another way.  
  25.   
  26.   
  27. Note: Any documents  
  28.  that your app stores explicitly in iCloud (using the iCloud storage APIs) are not backed up with your app. (Those documents are already stored in the user’s iCloud account and therefore do not need to be backed up separately.)  
  29.   
  30. For information on which directories are backed up, and for information about iCloud document storage, see iOS  
  31.  App Programming Guide.  
  32.   
  33.   
  34.   
  35.   
  36. Automatic Reference Counting  
  37.   
  38.   
  39. Automatic Reference Counting (ARC)  
  40.   
  41. is a compiler-level feature that simplifies the process of managing the lifetimes of Objective-C objects. Instead of you having to remember when to retain or release an object, ARC evaluates the lifetime requirements of your objects and automatically  
  42.  inserts the appropriate method calls at compile time.  
  43.   
  44.   
  45. To be able to deliver these features, ARC imposes some restrictions—primarily enforcing some best practices and disallowing some other practices:  

    • Do not call the retainreleaseautorelease, or dealloc methods in your code.

    • In addition, you cannot implement custom retain or release methods.
    • Because you do not call the release method, there is often no need to implement a custom dealloc method—the compiler synthesizes all that is required to relinquish ownership of instance variables. You can provide a custom implementation of dealloc if you need to manage other resources.
    • Do not store object pointers in C structures.

    • Store object pointers in other objects instead of in structures.
    • Do not directly cast between object and nonobject types (for example, between id and void*).

    • You must use special functions or casts that tell the compiler about an object’s lifetime. You use these to cast between Objective-C objects and Core Foundation objects.
    • You cannot use NSAutoreleasePool objects.

    • Instead, you must use a new @autoreleasepool keyword to mark the start of an autorelease block. The contents of the block are enclosed by curly braces, as shown in the following example:

查看文本打印
  1. @autoreleasepool  
查看文本打印
  1. @autoreleasepool  
查看文本打印
  1. {  
查看文本打印
  1. {  
查看文本打印
  1. // Your code here  
查看文本打印
  1. // Your code here  
查看文本打印
  1. }  
查看文本打印
  1. }  

查看文本打印
  1. ARC encourages you to think in terms of object graphs, and the relationships between objects, rather than in terms of retain and release. For this  
  2.  reason, ARC introduces new lifetime qualifiers for objects, including zeroing weak references. The value of a zeroing weak reference is automatically set to nil if the object  
  3.  to which it points is deallocated. There are qualifiers for variables, and new weak and strong declared  
  4.  property attributes, as illustrated in the following examples:  
  5.   
  6.   
  7.   
  8.   
  9.   
  10.   
  11.   
  12.   
  13. // The following declaration is a synonym for: @property(retain) MyClass *myObject;  
  14.   
  15.   
  16.   
  17.   
  18. @property(strong) MyClass *myObject;  
  19.   
  20.   
  21.   
  22.   
  23.    
  24.   
  25.   
  26.   
  27.   
  28. // The following declaration is similar to "@property(assign) MyOtherClass *delegate;"  
  29.   
  30.   
  31.   
  32.   
  33. // except that if the MyOtherClass instance is deallocated,  
  34.   
  35.   
  36.   
  37.   
  38. // the property value is set to nil instead of remaining as a dangling pointer  
  39.   
  40.   
  41.   
  42.   
  43. @property(weak) MyOtherClass *delegate;  
  44.   
  45.   
  46.   
  47.   
  48.   
  49.   
  50.   
  51.   
  52. Xcode provides migration tools to help convert existing projects to use ARC. For more information about how to perform this migration, see What's  
  53.  New In Xcode. For more information about ARC itself, see Transitioning  
  54.  to ARC Release Notes.  
  55.   
  56.   
  57.   
  58.   
  59. Storyboards  
  60.   
  61.   
  62. Storyboards are the new way to define your app’s user interface. In the past, you used nib files to define your user interface one view controller at a time. A storyboard file captures your entire user interface  
  63.  in one place and lets you define both the individual view controllers and the transitions between those view controllers. As a result, storyboards capture the flow of your overall user interface in addition to the content you present.  
  64.   
  65.   
  66.   
  67. If you are creating new apps, the Xcode templates come preconfigured to use storyboards. For other apps, the process for using storyboards is as follows:  
查看文本打印
  1. ARC encourages you to think in terms of object graphs, and the relationships between objects, rather than in terms of retain and release. For this  
  2.  reason, ARC introduces new lifetime qualifiers for objects, including zeroing weak references. The value of a zeroing weak reference is automatically set to nil if the object  
  3.  to which it points is deallocated. There are qualifiers for variables, and new weak and strong declared  
  4.  property attributes, as illustrated in the following examples:  
  5.   
  6.   
  7.   
  8.   
  9.   
  10.   
  11.   
  12.   
  13. // The following declaration is a synonym for: @property(retain) MyClass *myObject;  
  14.   
  15.   
  16.   
  17.   
  18. @property(strong) MyClass *myObject;  
  19.   
  20.   
  21.   
  22.   
  23.    
  24.   
  25.   
  26.   
  27.   
  28. // The following declaration is similar to "@property(assign) MyOtherClass *delegate;"  
  29.   
  30.   
  31.   
  32.   
  33. // except that if the MyOtherClass instance is deallocated,  
  34.   
  35.   
  36.   
  37.   
  38. // the property value is set to nil instead of remaining as a dangling pointer  
  39.   
  40.   
  41.   
  42.   
  43. @property(weak) MyOtherClass *delegate;  
  44.   
  45.   
  46.   
  47.   
  48.   
  49.   
  50.   
  51.   
  52. Xcode provides migration tools to help convert existing projects to use ARC. For more information about how to perform this migration, see What's  
  53.  New In Xcode. For more information about ARC itself, see Transitioning  
  54.  to ARC Release Notes.  
  55.   
  56.   
  57.   
  58.   
  59. Storyboards  
  60.   
  61.   
  62. Storyboards are the new way to define your app’s user interface. In the past, you used nib files to define your user interface one view controller at a time. A storyboard file captures your entire user interface  
  63.  in one place and lets you define both the individual view controllers and the transitions between those view controllers. As a result, storyboards capture the flow of your overall user interface in addition to the content you present.  
  64.   
  65.   
  66.   
  67. If you are creating new apps, the Xcode templates come preconfigured to use storyboards. For other apps, the process for using storyboards is as follows:  

查看文本打印
  1. Configure your app’s Info.plist file  
  2.  to use storyboards:  
  3.   
  4.   
  5. Add the UIMainStoryboardFile key and set its value to the name of your storyboard file.  
  6. Remove the existing NSMainNibFile key. (Storyboards replace the main nib file.)  
  7. Create and configure the storyboard file in Xcode; see “Creating  
  8.  Storyboard Files.”  
  9. Update your view controllers to handle storyboard transitions; see “Preparing  
  10.  to Transition to a New View Controller.”  
  11. If you ever need to present a view controller manually (perhaps to support motion-related events), use the storyboard classes to retrieve and present the appropriate view controller; see “Presenting  
  12.  Storyboard View Controllers Programmatically.”  
  13. Apps can use a single storyboard file to store all of their view controllers and views. At build time, Interface Builder takes the contents of the storyboard file and divides it up into discrete pieces that can be loaded individually for better performance.  
  14.  Your app never needs to manipulate these pieces directly, though. All you must do is declare the main storyboard in your app’s Info.plist file. UIKit handles the rest.  
查看文本打印
  1. Configure your app’s Info.plist file  
  2.  to use storyboards:  
  3.   
  4.   
  5. Add the UIMainStoryboardFile key and set its value to the name of your storyboard file.  
  6. Remove the existing NSMainNibFile key. (Storyboards replace the main nib file.)  
  7. Create and configure the storyboard file in Xcode; see “Creating  
  8.  Storyboard Files.”  
  9. Update your view controllers to handle storyboard transitions; see “Preparing  
  10.  to Transition to a New View Controller.”  
  11. If you ever need to present a view controller manually (perhaps to support motion-related events), use the storyboard classes to retrieve and present the appropriate view controller; see “Presenting  
  12.  Storyboard View Controllers Programmatically.”  
  13. Apps can use a single storyboard file to store all of their view controllers and views. At build time, Interface Builder takes the contents of the storyboard file and divides it up into discrete pieces that can be loaded individually for better performance.  
  14.  Your app never needs to manipulate these pieces directly, though. All you must do is declare the main storyboard in your app’s Info.plist file. UIKit handles the rest.  
查看文本打印
  1. Creating Storyboard Files  
  2.   
  3.   
  4. You use Interface Builder to create storyboard files for your app. Most apps need only one storyboard file, but you can create multiple storyboard files if you want. Every storyboard file has a view controller  
  5.  known as the initial view controller. This view controller represents the entry point into the storyboard. For example, in your app’s main storyboard file, the initial view controller would be the first view controller presented by your app.  
  6.   
  7.   
  8.   
  9. Each view controller in a storyboard file manages a single scene. For iPhone apps, a scene manages one screen’s worth of content, but for iPad apps the content from multiple scenes can be on screen simultaneously.  
  10.  To add new scenes to your storyboard file, drag a view controller from the library to the storyboard canvas. You can then add controls and views to the view controller’s view just as you would for a nib file. And as before, you can configure outlets and actions  
  11.  between your view controller and its views.  
  12.   
  13.   
  14.   
  15. When you want to transition from one view controller to another, Control-click a button, table view cell, or other trigger object in one view controller, and drag to the view controller for a different scene.  
  16.  Dragging between view controllers creates a segue, which appears in Interface Builder as a configurable object. Segues support all of the same types of transitions available in UIKit, such as modal transitions and navigation transitions. You can also define  
  17.  custom transitions and transitions that replace one view controller with another.  
  18.   
  19.   
  20.   
  21. For more information about using Interface Builder to configure your storyboard files, see What's  
  22.  New In Xcode.  
  23.   
  24.   
  25.   
  26.   
  27. Preparing to Transition to a New View Controller  
  28.   
  29.   
  30. Whenever a user triggers a segue in the current scene, the storyboard runtime calls the prepareForSegue:sender: method  
  31.  of the current view controller. This method gives the current view controller an opportunity to pass any needed data to the view controller that is about to be displayed. When implementing your view controller classes, you should override this method and use  
  32.  it to handle these transitions.  
  33.   
  34.   
  35.   
  36. For more information about implementing the methods of the UIViewController class, see UIViewController  
  37.  Class Reference.  
  38.   
  39.   
  40.   
  41.   
  42. Presenting Storyboard View Controllers Programmatically  
  43.   
  44.   
  45. Although the storyboard runtime usually handles transitions between view controllers, you can also trigger segues programmatically from your code. You might do so when setting up the segue in Interface Builder  
  46.  is not possible, such as when using accelerometer events to trigger the transition. There are several options for transitioning to a new view controller:  
查看文本打印
  1. Creating Storyboard Files  
  2.   
  3.   
  4. You use Interface Builder to create storyboard files for your app. Most apps need only one storyboard file, but you can create multiple storyboard files if you want. Every storyboard file has a view controller  
  5.  known as the initial view controller. This view controller represents the entry point into the storyboard. For example, in your app’s main storyboard file, the initial view controller would be the first view controller presented by your app.  
  6.   
  7.   
  8.   
  9. Each view controller in a storyboard file manages a single scene. For iPhone apps, a scene manages one screen’s worth of content, but for iPad apps the content from multiple scenes can be on screen simultaneously.  
  10.  To add new scenes to your storyboard file, drag a view controller from the library to the storyboard canvas. You can then add controls and views to the view controller’s view just as you would for a nib file. And as before, you can configure outlets and actions  
  11.  between your view controller and its views.  
  12.   
  13.   
  14.   
  15. When you want to transition from one view controller to another, Control-click a button, table view cell, or other trigger object in one view controller, and drag to the view controller for a different scene.  
  16.  Dragging between view controllers creates a segue, which appears in Interface Builder as a configurable object. Segues support all of the same types of transitions available in UIKit, such as modal transitions and navigation transitions. You can also define  
  17.  custom transitions and transitions that replace one view controller with another.  
  18.   
  19.   
  20.   
  21. For more information about using Interface Builder to configure your storyboard files, see What's  
  22.  New In Xcode.  
  23.   
  24.   
  25.   
  26.   
  27. Preparing to Transition to a New View Controller  
  28.   
  29.   
  30. Whenever a user triggers a segue in the current scene, the storyboard runtime calls the prepareForSegue:sender: method  
  31.  of the current view controller. This method gives the current view controller an opportunity to pass any needed data to the view controller that is about to be displayed. When implementing your view controller classes, you should override this method and use  
  32.  it to handle these transitions.  
  33.   
  34.   
  35.   
  36. For more information about implementing the methods of the UIViewController class, see UIViewController  
  37.  Class Reference.  
  38.   
  39.   
  40.   
  41.   
  42. Presenting Storyboard View Controllers Programmatically  
  43.   
  44.   
  45. Although the storyboard runtime usually handles transitions between view controllers, you can also trigger segues programmatically from your code. You might do so when setting up the segue in Interface Builder  
  46.  is not possible, such as when using accelerometer events to trigger the transition. There are several options for transitioning to a new view controller:  

    • If a storyboard file contains an existing segue between the current view controller and the destination view controller (perhaps triggered by some other control in the view controller), you can trigger that segue programmatically using the performSegueWithIdentifier:sender: method of UIViewController.

    • If there is no segue between the view controllers but the destination view controller is defined in the storyboard file, first load the view controller programmatically using theinstantiateViewControllerWithIdentifier: method of UIStoryboard. Then present the view controller using any of the existing programmatic means, such as by pushing it on a navigation stack.

    • If the destination view controller is not in the storyboard file, create it programmatically and present it as described in View Controller Programming Guide for iOS.

查看文本打印
  1. Newsstand Support  
  2.   
  3.   
  4. Newsstand provides a central place for users to read magazines and newspapers. Publishers who want to deliver their magazine and newspaper content through Newsstand can create their own iOS apps using the Newsstand  
  5.  Kit framework (NewsstandKit.framework), although doing so is not required. A big advantage of the Newsstand Kit framework, however, is that you can use it to initiate background  
  6.  downloads of new magazine and newspaper issues. After you start a download, the system handles the download operation and notifies your app when the new content is available.  
  7.   
  8.   
  9.   
  10. Unlike other iOS apps, Newsstand apps appears only in Newsstand itself, not in a user’s Home screen. And instead of displaying an app icon, the app typically displays the cover of their most recent issue, with  
  11.  some additional adornments provided by Newsstand. When the user taps that cover art, your app launches normally to present the current issue or any back issues that were downloaded and are still available.  
  12.   
  13.   
  14. Note: Newsstand  
  15.  apps must include the UINewsstandApp key in their Info.plist file to indicate that they  
  16.  support Newsstand. For more information about this key, seeInformation  
  17.  Property List Key Reference.  
  18.   
  19. Creating an app that uses Newsstand Kit requires some interplay between the actual app and the content servers that you manage. Your servers are responsible for notifying the app when new content is available,  
  20.  typically using a push notification. If your Newsstand app includes the UIBackgroundModes key with the newsstand-content value  
  21.  in itsInfo.plist file, your Newsstand app is launched in the background so that it can start downloading the latest issue. The download process itself is managed by the system,  
  22.  which notifies your app when the content is fully downloaded and available.  
  23.   
  24.   
  25.   
  26. When your server is alerting your app of a new issue, that server should include the content-available property (with a value  
  27.  of 1in the JSON payload. This property tells the system that it should launch your app so that it can begin downloading the new issue. Apps are launched and alerted to new  
  28.  issues once in a 24-hour period at most, although if your app is running when the notification arrives, it can begin downloading the content immediately.  
  29.   
  30.   
  31.   
  32. In addition to your server providing content for each new issue, it should also provide cover art to present in Newsstand when that issue is available. This cover art is displayed in place of the app’s default  
  33.  icon, which is specified by the Newsstand-specific icons in the CFBundleIcons key of your app’s Info.plist file.  
  34.  Cover art gives users a more visual cue that a new issue is available. Your app can also add a badge to new issues.  
  35.   
  36.   
  37.   
  38. For information about the classes you use to manage Newsstand downloads, see Newsstand  
  39.  Kit Framework Reference. For information about how to use push notifications to notify your apps, see Local  
  40.  and Push Notification Programming Guide.  
  41.   
  42.   
  43.   
  44.   
  45. AirPlay Improvements  
  46.   
  47.   
  48. AirPlay lets users stream audio and video from an iOS-based device to AirPlay–enabled devices such as televisions and audio systems. In iOS 5, developers can now use AirPlay to present app content on a nearby  
  49.  Apple TV 2. Users can now mirror the content of an iPad 2 to an Apple TV using AirPlay for any app. And developers who want to display different content (instead of mirroring) can assign a new window object to any UIScreen objects  
  50.  connected to an iPad 2 via AirPlay.  
  51.   
  52.   
  53.   
  54. In addition, you can now take advantage of AirPlay in the following ways:  
查看文本打印
  1. Newsstand Support  
  2.   
  3.   
  4. Newsstand provides a central place for users to read magazines and newspapers. Publishers who want to deliver their magazine and newspaper content through Newsstand can create their own iOS apps using the Newsstand  
  5.  Kit framework (NewsstandKit.framework), although doing so is not required. A big advantage of the Newsstand Kit framework, however, is that you can use it to initiate background  
  6.  downloads of new magazine and newspaper issues. After you start a download, the system handles the download operation and notifies your app when the new content is available.  
  7.   
  8.   
  9.   
  10. Unlike other iOS apps, Newsstand apps appears only in Newsstand itself, not in a user’s Home screen. And instead of displaying an app icon, the app typically displays the cover of their most recent issue, with  
  11.  some additional adornments provided by Newsstand. When the user taps that cover art, your app launches normally to present the current issue or any back issues that were downloaded and are still available.  
  12.   
  13.   
  14. Note: Newsstand  
  15.  apps must include the UINewsstandApp key in their Info.plist file to indicate that they  
  16.  support Newsstand. For more information about this key, seeInformation  
  17.  Property List Key Reference.  
  18.   
  19. Creating an app that uses Newsstand Kit requires some interplay between the actual app and the content servers that you manage. Your servers are responsible for notifying the app when new content is available,  
  20.  typically using a push notification. If your Newsstand app includes the UIBackgroundModes key with the newsstand-content value  
  21.  in itsInfo.plist file, your Newsstand app is launched in the background so that it can start downloading the latest issue. The download process itself is managed by the system,  
  22.  which notifies your app when the content is fully downloaded and available.  
  23.   
  24.   
  25.   
  26. When your server is alerting your app of a new issue, that server should include the content-available property (with a value  
  27.  of 1in the JSON payload. This property tells the system that it should launch your app so that it can begin downloading the new issue. Apps are launched and alerted to new  
  28.  issues once in a 24-hour period at most, although if your app is running when the notification arrives, it can begin downloading the content immediately.  
  29.   
  30.   
  31.   
  32. In addition to your server providing content for each new issue, it should also provide cover art to present in Newsstand when that issue is available. This cover art is displayed in place of the app’s default  
  33.  icon, which is specified by the Newsstand-specific icons in the CFBundleIcons key of your app’s Info.plist file.  
  34.  Cover art gives users a more visual cue that a new issue is available. Your app can also add a badge to new issues.  
  35.   
  36.   
  37.   
  38. For information about the classes you use to manage Newsstand downloads, see Newsstand  
  39.  Kit Framework Reference. For information about how to use push notifications to notify your apps, see Local  
  40.  and Push Notification Programming Guide.  
  41.   
  42.   
  43.   
  44.   
  45. AirPlay Improvements  
  46.   
  47.   
  48. AirPlay lets users stream audio and video from an iOS-based device to AirPlay–enabled devices such as televisions and audio systems. In iOS 5, developers can now use AirPlay to present app content on a nearby  
  49.  Apple TV 2. Users can now mirror the content of an iPad 2 to an Apple TV using AirPlay for any app. And developers who want to display different content (instead of mirroring) can assign a new window object to any UIScreen objects  
  50.  connected to an iPad 2 via AirPlay.  
  51.   
  52.   
  53.   
  54. In addition, you can now take advantage of AirPlay in the following ways:  

    • Apps that use AV Foundation can now use the AVPlayer class to stream audio and video content over AirPlay; see AV Foundation Framework Reference.

    • The Media Player framework includes support for displaying “Now Playing” information in several locations, including as part of the content delivered over AirPlay; seeMPNowPlayingInfoCenter Class Reference.

    • The UIWebView class now supports the presentation of multimedia content over AirPlay. This support is enabled by default, but you can opt out of it if you want to.

查看文本打印
  1. Note: In  
  2.  iOS 5, AirPlay is enabled by default for all objects that support it. If you do not want your app’s content to be playable over AirPlay, you must opt out explicitly.  
  3.   
  4. For more information about delivering content over AirPlay, and the support media formats, see AirPlay  
  5.  Overview.  
  6.   
  7.   
  8.   
  9.   
  10. New Frameworks  
  11.   
  12.   
  13. In iOS 5.0, there are several new frameworks you should investigate.  
  14.   
  15.   
  16.   
  17.   
  18. GLKit Framework  
  19.   
  20.   
  21. The GLKit framework (GLKit.framework) contains a set of Objective-C based utility classes that simplify the effort required  
  22.  to create an OpenGL ES 2.0 app. GLKit provides support for four key areas of app development:  
查看文本打印
  1. Note: In  
  2.  iOS 5, AirPlay is enabled by default for all objects that support it. If you do not want your app’s content to be playable over AirPlay, you must opt out explicitly.  
  3.   
  4. For more information about delivering content over AirPlay, and the support media formats, see AirPlay  
  5.  Overview.  
  6.   
  7.   
  8.   
  9.   
  10. New Frameworks  
  11.   
  12.   
  13. In iOS 5.0, there are several new frameworks you should investigate.  
  14.   
  15.   
  16.   
  17.   
  18. GLKit Framework  
  19.   
  20.   
  21. The GLKit framework (GLKit.framework) contains a set of Objective-C based utility classes that simplify the effort required  
  22.  to create an OpenGL ES 2.0 app. GLKit provides support for four key areas of app development:  

    • The GLKView and GLKViewController classes provide a standard implementation of an OpenGL ES–enabled view and associated rendering loop. The view manages the underlying framebuffer object on behalf of the app; your app just draws to it.

    • The GLKTextureLoader class provides image conversion and loading routines to your app, allowing it to automatically load texture images into your context. It can load textures synchronously or asynchronously. When loading textures asynchronously, your app provides a completion handler block to be called when the texture is loaded into your context.

    • The GLKit framework provides implementations of vector, matrix, and quaternions as well as a matrix stack operation to provide the same functionality found in OpenGL ES 1.1.

    • The GLKBaseEffectGLKSkyboxEffect, and GLKReflectionMapEffect classes provide configurable graphics shaders that implement commonly used graphics operations. In particular, the GLKBaseEffect class implements the lighting and material model found in the OpenGL ES 1.1 specification, simplifying the effort required to migrate an app from OpenGL ES 1.1 to OpenGL ES 2.0.

查看文本打印
  1. For information about the classes of the GLKit framework, see GLKit  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Core Image Framework  
  8.   
  9.   
  10. The Core Image framework (CoreImage.framework) provides a powerful set of built-in filters for manipulating video and still  
  11.  images. You can use the built-in filters for everything from simple operations (like touching up and correcting photos) to more advanced operations (like face and feature detection). The advantage of using these filters is that they operate in a nondestructive  
  12.  manner so that your original images are never changed directly. In addition, Core Image takes advantage of the available CPU and GPU processing power to ensure that operations are fast and efficient.  
  13.   
  14.   
  15.   
  16. The CIImage class  
  17.  provides access to a standard set of filters that you can use to improve the quality of a photograph. To create other types of filters, you can create and configure a CIFilter object  
  18.  for the appropriate filter type.  
  19.   
  20.   
  21.   
  22. For information about the classes and filters of the Core Image framework, see Core  
  23.  Image Reference Collection.  
  24.   
  25.   
  26.   
  27.   
  28. Twitter Framework  
  29.   
  30.   
  31. The Twitter framework (Twitter.framework) provides support for sending Twitter requests on behalf of the user and for composing  
  32.  and sending tweets. For requests, the framework handles the user authentication part of the request for you and provides a template for creating the HTTP portion of the request. (Refer to the Twitter API for populating the content of the request.) The composition  
  33.  of tweets is accomplished using the TWTweetComposeViewController class,  
  34.  which is a view controller that you post with your proposed tweet content. This class gives the user a chance to edit or modify the tweet before sending it.  
  35.   
  36.   
  37.   
  38. Users control whether an app is allowed to communicate with Twitter on their behalf using Settings. The Twitter framework also works in conjunction with the Accounts framework (Accounts.framework)  
  39.  to access the user’s account.  
  40.   
  41.   
  42.   
  43. For information about the classes of the Twitter framework, see Twitter  
  44.  Framework Reference. For information about the Accounts framework, see “Accounts  
  45.  Framework.”  
  46.   
  47.   
  48.   
  49.   
  50. Accounts Framework  
  51.   
  52.   
  53. The Accounts framework (Accounts.framework) provides a single sign-on model for certain user accounts. Single sign-on improves  
  54.  the user experience, because apps no longer need to prompt a user separately for login information related to an account. It also simplifies the development model for you by managing the account authorization process for your app. In iOS 5.0, apps can use  
  55.  this framework in conjunction with the Twitter framework to access a user’s Twitter account.  
  56.   
  57.   
  58.   
  59. For more information about the classes of the Accounts framework, see Accounts  
  60.  Framework Reference.  
  61.   
  62.   
  63.   
  64.   
  65. Generic Security Services Framework  
  66.   
  67.   
  68. The Generic Security Services framework (GSS.framework) provides a standard set of security-related services to iOS apps. The  
  69.  basic interfaces of this framework are specified in IETF RFC  
  70.  2743 and RFC  
  71.  4401. In addition to offering the standard interfaces, iOS includes some additions for managing credentials that are not specified by the standard but that are required by many apps.  
  72.   
  73.   
  74.   
  75. For information about the interfaces of the GSS framework, see the header files.  
  76.   
  77.   
  78.   
  79.   
  80. Core Bluetooth  
  81.   
  82.   
  83. The Core Bluetooth framework (CoreBluetooth.framework) allows developers to interact specifically with Bluetooth Low-Energy  
  84.  ("LE") accessories. The Objective-C interfaces of this framework allow you to scan for LE accessories, connect and disconnect to ones you find, read and write attributes within a service, register for service and attribute change notifications, and much more.  
  85.   
  86.   
  87.   
  88. For more information about the interfaces of the Core Bluetooth framework, see the header files.  
  89.   
  90.   
  91.   
  92.   
  93. App Design-Level Improvements  
  94.   
  95.   
  96. The following sections describe new capabilities that you can incorporate into the model, view, and controller layers of your app.  
  97.   
  98.   
  99.   
  100.   
  101. Document Support  
  102.   
  103.   
  104. Cocoa Touch now includes a UIDocument class  
  105.  for managing the data associated with user documents. If you are implementing a document-based app, this class reduces the amount of work you must do to manage your document data. In addition to providing a container for all of your document-related data,  
  106.  the UIDocument class provides built-in support for a number of features:  
查看文本打印
  1. For information about the classes of the GLKit framework, see GLKit  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Core Image Framework  
  8.   
  9.   
  10. The Core Image framework (CoreImage.framework) provides a powerful set of built-in filters for manipulating video and still  
  11.  images. You can use the built-in filters for everything from simple operations (like touching up and correcting photos) to more advanced operations (like face and feature detection). The advantage of using these filters is that they operate in a nondestructive  
  12.  manner so that your original images are never changed directly. In addition, Core Image takes advantage of the available CPU and GPU processing power to ensure that operations are fast and efficient.  
  13.   
  14.   
  15.   
  16. The CIImage class  
  17.  provides access to a standard set of filters that you can use to improve the quality of a photograph. To create other types of filters, you can create and configure a CIFilter object  
  18.  for the appropriate filter type.  
  19.   
  20.   
  21.   
  22. For information about the classes and filters of the Core Image framework, see Core  
  23.  Image Reference Collection.  
  24.   
  25.   
  26.   
  27.   
  28. Twitter Framework  
  29.   
  30.   
  31. The Twitter framework (Twitter.framework) provides support for sending Twitter requests on behalf of the user and for composing  
  32.  and sending tweets. For requests, the framework handles the user authentication part of the request for you and provides a template for creating the HTTP portion of the request. (Refer to the Twitter API for populating the content of the request.) The composition  
  33.  of tweets is accomplished using the TWTweetComposeViewController class,  
  34.  which is a view controller that you post with your proposed tweet content. This class gives the user a chance to edit or modify the tweet before sending it.  
  35.   
  36.   
  37.   
  38. Users control whether an app is allowed to communicate with Twitter on their behalf using Settings. The Twitter framework also works in conjunction with the Accounts framework (Accounts.framework)  
  39.  to access the user’s account.  
  40.   
  41.   
  42.   
  43. For information about the classes of the Twitter framework, see Twitter  
  44.  Framework Reference. For information about the Accounts framework, see “Accounts  
  45.  Framework.”  
  46.   
  47.   
  48.   
  49.   
  50. Accounts Framework  
  51.   
  52.   
  53. The Accounts framework (Accounts.framework) provides a single sign-on model for certain user accounts. Single sign-on improves  
  54.  the user experience, because apps no longer need to prompt a user separately for login information related to an account. It also simplifies the development model for you by managing the account authorization process for your app. In iOS 5.0, apps can use  
  55.  this framework in conjunction with the Twitter framework to access a user’s Twitter account.  
  56.   
  57.   
  58.   
  59. For more information about the classes of the Accounts framework, see Accounts  
  60.  Framework Reference.  
  61.   
  62.   
  63.   
  64.   
  65. Generic Security Services Framework  
  66.   
  67.   
  68. The Generic Security Services framework (GSS.framework) provides a standard set of security-related services to iOS apps. The  
  69.  basic interfaces of this framework are specified in IETF RFC  
  70.  2743 and RFC  
  71.  4401. In addition to offering the standard interfaces, iOS includes some additions for managing credentials that are not specified by the standard but that are required by many apps.  
  72.   
  73.   
  74.   
  75. For information about the interfaces of the GSS framework, see the header files.  
  76.   
  77.   
  78.   
  79.   
  80. Core Bluetooth  
  81.   
  82.   
  83. The Core Bluetooth framework (CoreBluetooth.framework) allows developers to interact specifically with Bluetooth Low-Energy  
  84.  ("LE") accessories. The Objective-C interfaces of this framework allow you to scan for LE accessories, connect and disconnect to ones you find, read and write attributes within a service, register for service and attribute change notifications, and much more.  
  85.   
  86.   
  87.   
  88. For more information about the interfaces of the Core Bluetooth framework, see the header files.  
  89.   
  90.   
  91.   
  92.   
  93. App Design-Level Improvements  
  94.   
  95.   
  96. The following sections describe new capabilities that you can incorporate into the model, view, and controller layers of your app.  
  97.   
  98.   
  99.   
  100.   
  101. Document Support  
  102.   
  103.   
  104. Cocoa Touch now includes a UIDocument class  
  105.  for managing the data associated with user documents. If you are implementing a document-based app, this class reduces the amount of work you must do to manage your document data. In addition to providing a container for all of your document-related data,  
  106.  the UIDocument class provides built-in support for a number of features:  

    • Asynchronous reading and writing of data on a background queue, allowing your app to remain responsive to users while reading and writing operations occur.

    • Support for coordinated reading and writing of documents, which is required for documents in iCloud storage.

    • Safe saving of document data by writing data first to a temporary file and then replacing the current document file with it.

    • Support for resolving conflicts between different versions of your document if a conflict occurs.

    • Automatic saving of document data at opportune moments.

    • Support for flat file and package file representations on disk.

    • For apps that use Core Data to manage their content, there is also a UIManagedDocument subclass to manage interactions with documents in the database.

查看文本打印
  1. If you are implementing an app that supports iCloud storage, the use of document objects makes the job of storing files in iCloud much easier. Document objects are file presenters and handle many of iCloud-related  
  2.  notifications that you might otherwise have to handle yourself. For more information about supporting iCloud storage, see “iCloud  
  3.  Storage APIs.”  
  4.   
  5.   
  6.   
  7. For information about the UIDocument class, see UIDocument  
  8.  Class Reference. For information about the UIManagedDocument class, see UIManagedDocument  
  9.  Class Reference.  
  10.   
  11.   
  12.   
  13.   
  14. Data Protection Improvements  
  15.   
  16.   
  17. Introduced in iOS 4.0, data protection lets you store app and user data files on disk in an encrypted format so that they can be accessed only when a user’s device is unlocked. In iOS 5.0, you now have more flexibility  
  18.  regarding when your app can access protected files.  
查看文本打印
  1. If you are implementing an app that supports iCloud storage, the use of document objects makes the job of storing files in iCloud much easier. Document objects are file presenters and handle many of iCloud-related  
  2.  notifications that you might otherwise have to handle yourself. For more information about supporting iCloud storage, see “iCloud  
  3.  Storage APIs.”  
  4.   
  5.   
  6.   
  7. For information about the UIDocument class, see UIDocument  
  8.  Class Reference. For information about the UIManagedDocument class, see UIManagedDocument  
  9.  Class Reference.  
  10.   
  11.   
  12.   
  13.   
  14. Data Protection Improvements  
  15.   
  16.   
  17. Introduced in iOS 4.0, data protection lets you store app and user data files on disk in an encrypted format so that they can be accessed only when a user’s device is unlocked. In iOS 5.0, you now have more flexibility  
  18.  regarding when your app can access protected files.  

    • Using the NSFileProtectionCompleteUnlessOpen option, your app can access a file while the device is unlocked and, if you keep the file open, continue to access that file after the user locks the device.

    • Using the NSFileProtectionCompleteUntilFirstUserAuthentication option, your app cannot access the file while the device is booting or until the user unlocks the device. After the user unlocks the device for the first time, you can access the file even if the user subsequently locks the device again.

You should protect files as soon as possible after creating them. For information about how to protect files, see iOS App Programming Guide.

Custom Appearance for UIKit Controls

You can now customize the appearance of many UIKit views and controls to give your app a unique look and feel. For example, you might use these customizations to make the standard system controls match the branding for the rest of your app.

UIKit supports the following customizations:

    • You can set the tint color, background image, and title position properties (among other) on a wide variety of objects, including toolbars, navigation bars, search bars, buttons, sliders, and some other controls.

    • You can set attributes of some objects directly, or you can set the default attributes to use for a class using an appearance proxy.

  • 查看文本打印
    1. An appearance proxy is an object you use to modify the default appearance of visual objects such as views and bar items. Classes that adopt the UIAppearance protocol  
    2.  support the use of an appearance proxy. To modify the default appearance of such a class, retrieve its proxy object using the appearance class  
    3.  method and call the returned object’s methods to set new default values. A proxy object implements those methods and properties from its proxied class that are tagged with the UI_APPEARANCE_SELECTORmacro.  
    4.  For example, you can use a proxy object to change the default tint color (through the progressTintColor or trackTintColor properties)  
    5.  of the UIProgressViewclass.  
    查看文本打印
    1. An appearance proxy is an object you use to modify the default appearance of visual objects such as views and bar items. Classes that adopt the UIAppearance protocol  
    2.  support the use of an appearance proxy. To modify the default appearance of such a class, retrieve its proxy object using the appearance class  
    3.  method and call the returned object’s methods to set new default values. A proxy object implements those methods and properties from its proxied class that are tagged with the UI_APPEARANCE_SELECTORmacro.  
    4.  For example, you can use a proxy object to change the default tint color (through the progressTintColor or trackTintColor properties)  
    5.  of the UIProgressViewclass.  
    查看文本打印
    1. If you want to set a different default appearance based on how a given object is used in your app, you can do so using the proxy object returned by theappearanceWhenContainedIn: method  
    2.  instead. For example, you use this proxy object to set specific default values for a button only when it is contained inside a navigation bar.  
    3.   
    4. Any changes you make with a proxy object are applied, at view layout time, to all instances of the class that exist or that are subsequently created. However, you can still override the proxy defaults later using the methods and properties of a given instance.  
    5.   
    6. For information about the methods for customizing the appearance of a class, see the description of that class in UIKit  
    7.  Framework Reference.  
    8.   
    9.   
    10.   
    11.   
    12. Container View Controller Support  
    13.   
    14.   
    15. The UIViewController class  
    16.  now allows you to define your own custom container view controllers and present content in new and interesting ways. Examples of existing container view controllers include UINavigationController, UITabBarController,  
    17.  and UISplitViewController. These view controllers mix custom content with content provided by one or more separate view controller objects to create a unique presentation for  
    18.  app content. Container view controllers act as a parent for their contained view controllers, forwarding important messages about rotations and other relevant events to their children.  
    19.   
    20.   
    21.   
    22. For more information about view controllers and the methods you need to implement for container view controllers, see UIViewController  
    23.  Class Reference.  
    24.   
    25.   
    26.   
    27.   
    28. Settings  
    29.   
    30.   
    31. Apps that deliver custom preferences can now use a new radio group element. This element is similar to the multivalue element for selecting one item from a list of choices. The difference is that the radio group  
    32.  element displays its choices inline with your preferences instead of on a separate page.  
    33.   
    34.   
    35.   
    36. For more information about displaying app preferences using the Settings app, see “App-Related  
    37.  Resources” in iOS  
    38.  App Programming Guide. For information about the property-list keys you use to build your Settings bundle, see Settings  
    39.  Application Schema Reference.  
    40.   
    41.   
    42.   
    43.   
    44. Xcode Tools  
    45.   
    46.   
    47. The following sections describe the improvements to the Xcode tools and the support for developing iOS apps. For detailed information about the features available in Xcode 4.2, see What's  
    48.  New In Xcode.  
    49.   
    50.   
    51.   
    52.   
    53. Xcode Improvements  
    54.   
    55.   
    56. Xcode 4.2 adds support for many features that are available in iOS 5.0.  
    查看文本打印
    1. If you want to set a different default appearance based on how a given object is used in your app, you can do so using the proxy object returned by theappearanceWhenContainedIn: method  
    2.  instead. For example, you use this proxy object to set specific default values for a button only when it is contained inside a navigation bar.  
    3.   
    4. Any changes you make with a proxy object are applied, at view layout time, to all instances of the class that exist or that are subsequently created. However, you can still override the proxy defaults later using the methods and properties of a given instance.  
    5.   
    6. For information about the methods for customizing the appearance of a class, see the description of that class in UIKit  
    7.  Framework Reference.  
    8.   
    9.   
    10.   
    11.   
    12. Container View Controller Support  
    13.   
    14.   
    15. The UIViewController class  
    16.  now allows you to define your own custom container view controllers and present content in new and interesting ways. Examples of existing container view controllers include UINavigationController, UITabBarController,  
    17.  and UISplitViewController. These view controllers mix custom content with content provided by one or more separate view controller objects to create a unique presentation for  
    18.  app content. Container view controllers act as a parent for their contained view controllers, forwarding important messages about rotations and other relevant events to their children.  
    19.   
    20.   
    21.   
    22. For more information about view controllers and the methods you need to implement for container view controllers, see UIViewController  
    23.  Class Reference.  
    24.   
    25.   
    26.   
    27.   
    28. Settings  
    29.   
    30.   
    31. Apps that deliver custom preferences can now use a new radio group element. This element is similar to the multivalue element for selecting one item from a list of choices. The difference is that the radio group  
    32.  element displays its choices inline with your preferences instead of on a separate page.  
    33.   
    34.   
    35.   
    36. For more information about displaying app preferences using the Settings app, see “App-Related  
    37.  Resources” in iOS  
    38.  App Programming Guide. For information about the property-list keys you use to build your Settings bundle, see Settings  
    39.  Application Schema Reference.  
    40.   
    41.   
    42.   
    43.   
    44. Xcode Tools  
    45.   
    46.   
    47. The following sections describe the improvements to the Xcode tools and the support for developing iOS apps. For detailed information about the features available in Xcode 4.2, see What's  
    48.  New In Xcode.  
    49.   
    50.   
    51.   
    52.   
    53. Xcode Improvements  
    54.   
    55.   
    56. Xcode 4.2 adds support for many features that are available in iOS 5.0.  

    • The LLVM compiler supports Automatic Reference Counting (ARC), and Xcode includes a menu item to convert targets to use ARC. (For more information about ARC and about how to use it in your apps, see “Automatic Reference Counting.”)

    • The Interface Builder user interface provides support for creating storyboard files for your iOS apps. (For more information about using storyboards in your iOS apps, see“Storyboards.”)

    • In iOS Simulator, you can now simulate different locations for apps using the Core Location framework.

    • You can download your app data from an iOS device and automatically restore that data when debugging or testing in iOS simulator or on a device.

OpenGL ES Debugging

The debugging experience in Xcode has been updated to include a new workflow for debugging OpenGL ES apps. You can now use Xcode to do the following for your OpenGL ES apps:

    • Introspect OpenGL ES state information and objects such as view textures, shaders, and so on.

    • Set breakpoints on OpenGL ES errors, set conditional OpenGL ES entry point breakpoints, break on frame boundaries, and so on.

UI Automation Enhancements

The Automation instrument now includes a script editor and the ability to capture (record) actions into your script as you perform them on a device. There are also enhancements to the objects that you use in the Automation instrument to automate UI testing:

    • The UIATarget object can now simulate rotate gestures and location changes.

    • The UIAHost object supports executing a task from the Instruments app itself.

    • The UIAElement object can now simulate a rotate gesture centered on the element.

    • Several functions that were previously available only in UIAWindow and UIAPopover were moved to UIAElement because they are common to all element objects.

    • The UIAKeyboard object now supports performing a sequence of keyboard taps to simulate the typing of a string.

For information about the enhancements to the Automation instrument, see Instruments New Features User Guide. For information about the JavaScript objects and commands that you use in your scripts, see UI Automation JavaScript Reference.

Instruments

The Instruments app in Xcode 4.2 adds several new instruments for iOS developers:

    • System Trace for iOS—Uses several instruments to profile aspects of Mac OS X or iOS that could be affecting app performance, such as system calls, thread scheduling, and VM operations.

    • Network Connections instrument—Inspect how your app is using TCP/IP and UDP/IP connections. With this instrument it is possible to see how much data is flowing through each connection and for each app. You can also use it to display interesting statistics, such as round trip times and retransmission request information.

    • Network Activity (located in Energy Diagnostics)—Helps bridge the gap between networking (cellular and WiFi) and energy usage. You use it to display device-wide data flow through each network interface alongside energy usage level data that is taken directly from the battery.

查看文本打印
  1. For information about using these new instruments, see Instruments  
  2.  New Features User Guide  
  3.   
  4.   
  5.   
  6.   
  7. Additional Framework Enhancements  
  8.   
  9.   
  10. In addition to the items discussed in the preceding sections, the following frameworks have additional enhancements. For a complete list of new interfaces, see iOS  
  11.  5.0 API Diffs.  
  12.   
  13.   
  14.   
  15.   
  16. UIKit  
  17.   
  18.   
  19. The UIKit framework (UIKit.framework) includes the following enhancements:  
查看文本打印
  1. For information about using these new instruments, see Instruments  
  2.  New Features User Guide  
  3.   
  4.   
  5.   
  6.   
  7. Additional Framework Enhancements  
  8.   
  9.   
  10. In addition to the items discussed in the preceding sections, the following frameworks have additional enhancements. For a complete list of new interfaces, see iOS  
  11.  5.0 API Diffs.  
  12.   
  13.   
  14.   
  15.   
  16. UIKit  
  17.   
  18.   
  19. The UIKit framework (UIKit.framework) includes the following enhancements:  

    • The UIViewController class can now be used to create custom container view controllers; see “Container View Controller Support.”

    • The UIKit framework provides support for loading and using storyboards; see “Storyboards.”

    • Bars and bar button items can now be tinted and customized for your app; see “Custom Appearance for UIKit Controls.”

    • The UIPageViewController class is a new container view controller for creating page-turn transitions between view controllers.

    • The UIReferenceLibraryViewController class adds support for presenting a custom dictionary service to the user.

    • The UIImagePickerController class supports new options for specifying the quality of video recordings.

    • The UIStepper class is a new control for incrementing a floating-point value value up or down within a configurable range.

    • View-based animations now support cross-dissolve, flip-from-top, and flip-from-bottom animations; see UIView Class Reference.

    • The UIApplication class now reports the language directionality of the running app.

    • The UITableView class adds support for automatic row animations, moving rows and sections, multiselection, and copy and paste behaviors for cells.

    • The UIScreen class lets you specify overscan compensation behaviors for video delivered over AirPlay or through an attached HDMI cable. You can also programmatically set a screen’s brightness.

    • The UIScrollView class now exposes its gesture recognizers so that you can configure them more precisely for your app.

    • The UISegmentedControl class now supports proportional segment widths.

    • The UIAlertView class now supports password-style text entry and special configurations for entering text securely.

    • The UIColor class includes support for Core Image and new methods to retrieve individual color values.

    • The UIImage class includes support for Core Image, support for stretching an image by tiling part of its content, and support for looping animations.

    • The UITextInputTraits protocol adds support for a Twitter-specific keyboard and separate spell-checking behavior.

    • The UIAccessibility protocol includes new interfaces that define the activation point within an element and indicate whether an element is modal or contains hidden elements. There are also new notifications that inform you of changes in system-provided accessibility features, such as zoom, audio status, and closed captioning.

    • The UIAccessibilityReadingContent protocol allows you to provide a continuous, page-turning reading experience to VoiceOver users.

    • The UIAccessibilityIdentification protocol allows you to uniquely identify elements in your app so that you can refer to them in automation scripts.

    • The UIWebView class automatically supports the presentation of multimedia content over AirPlay. You can opt out of this behavior by changing the value in themediaPlaybackAllowsAirPlay property of the class. This class also exposes a scrollView property so that you can access the scrolling properties of your web interfaces.

查看文本打印
  1. For information about the classes of the UIKit framework, see UIKit  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. OpenGL ES  
  8.   
  9.   
  10. OpenGL ES (OpenGLES.framework) now includes the following new extensions:  
查看文本打印
  1. For information about the classes of the UIKit framework, see UIKit  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. OpenGL ES  
  8.   
  9.   
  10. OpenGL ES (OpenGLES.framework) now includes the following new extensions:  

    • The EXT_debug_label and EXT_debug_marker extensions allow you to annotate your OpenGL ES drawing code with information specific to your app. The OpenGL ES Performance Detective, the OpenGL ES Debugger, and the OpenGL ES Analyzer tools provided by Xcode all take advantage of these annotations.

    • The EXT_color_buffer_half_float extension allows 16-bit floating point formats to be specified for a frame buffer's color renderbuffer.

    • The EXT_occlusion_query_boolean extension allows your app to determine whether any pixels would be drawn by a primitive or by a group of primitives.

    • The EXT_separate_shader_objects extension allows your app to specify separate vertex and fragment shader programs.

    • The EXT_shadow_samplers extension provides support for shadow maps.

    • The EXT_texture_rg extension adds one-component and two-component texture formats suitable for use in programmable shaders.

As always, check for the existence of an extension before using it in your app.

OpenAL

The OpenAL framework (OpenAL.framework) has two significant extensions:

    • You can get notifications about source state changes and changes regarding the number of audio buffers that have been processed.

    • The Apple Spatial Audio extension in iOS 5.0 adds three audio effects that are especially useful for games: reverberation, obstruction effects, and occlusion effects.

查看文本打印
  1. For information about the OpenAL interfaces, see the header files.  
  2.   
  3.   
  4.   
  5.   
  6. Message UI  
  7.   
  8.   
  9. The Message UI framework (MessageUI.framework) adds a new notification for tracking changes to the device’s ability to send  
  10.  text messages. For information about the interfaces of the Message UI framework, see Message  
  11.  UI Framework Reference.  
  12.   
  13.   
  14.   
  15.   
  16. Media Player  
  17.   
  18.   
  19. The Media Player framework (MediaPlayer.framework) includes the following enhancements:  
查看文本打印
  1. For information about the OpenAL interfaces, see the header files.  
  2.   
  3.   
  4.   
  5.   
  6. Message UI  
  7.   
  8.   
  9. The Message UI framework (MessageUI.framework) adds a new notification for tracking changes to the device’s ability to send  
  10.  text messages. For information about the interfaces of the Message UI framework, see Message  
  11.  UI Framework Reference.  
  12.   
  13.   
  14.   
  15.   
  16. Media Player  
  17.   
  18.   
  19. The Media Player framework (MediaPlayer.framework) includes the following enhancements:  

    • There is now support for displaying “Now Playing” information in the lock screen and multitasking controls. This information can also be displayed on an Apple TV and with content delivered via AirPlay.

    • You can detect whether video is being streamed to an AirPlay device using the airPlayVideoActive property of the MPMoviePlayerController class.

    • Apps can now use the framework to play content from iTunes University.

查看文本打印
  1. For information about the classes in the Media Player framework, see Media  
  2.  Player Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Map Kit  
  8.   
  9.   
  10. The Map Kit framework (MapKit.framework) supports the ability to use heading data to rotate a map based on the user’s current  
  11.  orientation. As you can with the Maps app, you can configure your map view to scroll the map according to the user’s current location. For example, a walking tour app might use this to show the user their current location on the tour.  
  12.   
  13.   
  14.   
  15. For information on the interfaces you use to implement map scrolling and rotation, see Map  
  16.  Kit Framework Reference.  
  17.   
  18.   
  19. Note: If  
  20.  you are currently using Map Kit for geocoding, you should switch to using the Core Location framework for that feature; see “Core  
  21.  Location.”  
  22.   
  23.   
  24. iAd  
  25.   
  26.   
  27. The iAd framework (iAd.framework) provides new callback methods for developers who use multiple add networks and want to be  
  28.  notified when a new ad is available. ThebannerViewWillLoadAd: method  
  29.  (defined in the ADBannerViewDelegate protocol)  
  30.  is called when a banner has confirmed that an ad is available but before the ad is fully downloaded and ready to be presented. The interstitialAdWillLoad: method  
  31.  (defined in the ADInterstitialAdDelegate protocol)  
  32.  offers similar behavior for interstitial ads.  
  33.   
  34.   
  35.   
  36. For information about the classes of the iAd framework, see iAd  
  37.  Framework Reference.  
  38.   
  39.   
  40.   
  41.   
  42. Game Kit  
  43.   
  44.   
  45. The Game Kit framework (GameKit.framework) and Game Center now have the following features:  
查看文本打印
  1. For information about the classes in the Media Player framework, see Media  
  2.  Player Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Map Kit  
  8.   
  9.   
  10. The Map Kit framework (MapKit.framework) supports the ability to use heading data to rotate a map based on the user’s current  
  11.  orientation. As you can with the Maps app, you can configure your map view to scroll the map according to the user’s current location. For example, a walking tour app might use this to show the user their current location on the tour.  
  12.   
  13.   
  14.   
  15. For information on the interfaces you use to implement map scrolling and rotation, see Map  
  16.  Kit Framework Reference.  
  17.   
  18.   
  19. Note: If  
  20.  you are currently using Map Kit for geocoding, you should switch to using the Core Location framework for that feature; see “Core  
  21.  Location.”  
  22.   
  23.   
  24. iAd  
  25.   
  26.   
  27. The iAd framework (iAd.framework) provides new callback methods for developers who use multiple add networks and want to be  
  28.  notified when a new ad is available. ThebannerViewWillLoadAd: method  
  29.  (defined in the ADBannerViewDelegate protocol)  
  30.  is called when a banner has confirmed that an ad is available but before the ad is fully downloaded and ready to be presented. The interstitialAdWillLoad: method  
  31.  (defined in the ADInterstitialAdDelegate protocol)  
  32.  offers similar behavior for interstitial ads.  
  33.   
  34.   
  35.   
  36. For information about the classes of the iAd framework, see iAd  
  37.  Framework Reference.  
  38.   
  39.   
  40.   
  41.   
  42. Game Kit  
  43.   
  44.   
  45. The Game Kit framework (GameKit.framework) and Game Center now have the following features:  

    • The GKTurnBasedMatch class provides support for turn-based gaming, which allows games to create persistent matches whose state is stored in iCloud. Your game manages the state information for the match and determines which player must act to advance the state of the match.

    • Your game can now adjust the default leaderboard (implemented by the GKLeaderboard class) shown to each player. If your game does not change the default leaderboard for a player, that player sees the leaderboard configured for your app in iTunes Connect.

    • The GKNotificationBanner class implements a customizable banner similar to the banner shown to players when they log in to Game Center. Your game may use this banner to display messages to the player.

    • When your game reports an achievement, it can automatically display a banner to the player using the GKAchievement class.

    • GKMatchmakerViewController object can now add players to an existing match in addition to creating a new match.

    • The GKMatchDelegate protocol now includes a method to reconnect devices when a two-player match is disconnected.

For information abou the classes of the Game Kit framework, see Game Kit Framework Reference.

Foundation

The Foundation framework (Foundation.framework) includes the following enhancements:

    • The NSFileManager class includes new methods for moving a file to a user’s iCloud storage.

    • The new NSFileCoordinator class and NSFilePresenter protocol implement now locking support and notifications when manipulating documents in iCloud.

    • The new NSFileVersion class reports and manages conflicts between different versions of a file in iCloud.

    • The NSURL class includes new methods and constants to support syncing items to a user’s iCloud storage.

    • The new NSMetadataQuery class supports attributes for items synced to a user’s iCloud storage. Several other metadata-related classes were also added, includingNSMetadataItemNSMetadataQueryResultGroup, and NSMetadataQueryAttributeValueTuple.

    • The new NSJSONSerialization class is a new class that supports back-and-forth conversions between JSON data and Foundation types.

    • The new NSLinguisticTagger class is a new class lets you break down a sentence into its grammatical components, allowing the determination of nouns, verbs, adverbs, and so on. This tagging works fully for English and the class also provides a method to find out what capabilities are available for other languages.

    • This framework now includes the NSFileWrapper class for managing file packages—that is, files implemented as an opaque directory.

    • The new NSOrderedSet collection class offers the semantics of sets, whereby each element occurs at most once in the collection, but where elements are in a specific order.

    • Most delegate methods are now declared using formal protocols instead of as categories on NSObject.

查看文本打印
  1. For information about the classes of the Foundation framework, see Foundation  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. External Accessory  
  8.   
  9.   
  10. Apps that use the External Accessory framework to communicate with external accessories can now ask to be woken up if the app is suspended when its accessory delivers new data. Including the UIBackgroundModes key  
  11.  with the external-accessory value in your app’s Info.plist file keeps your accessory sessions  
  12.  open even when your app is suspended. (Prior to iOS 5, these sessions were closed automatically at suspend time.) When new data arrives for a given session, a suspended app is woken up and given time to process the new data. This type of behavior is designed  
  13.  for apps that work with heart-rate monitors and other types of accessories that need to deliver data at regular intervals.  
  14.   
  15.   
  16.   
  17. For more information about the UIBackgroundModes key, see Information  
  18.  Property List Key Reference. For information about interacting with external accessories, see External  
  19.  Accessory Programming Topics.  
  20.   
  21.   
  22.   
  23.   
  24. Event Kit and Event Kit UI  
  25.   
  26.   
  27. The Event Kit framework (EventKit.framework) includes the following enhancements:  
查看文本打印
  1. For information about the classes of the Foundation framework, see Foundation  
  2.  Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. External Accessory  
  8.   
  9.   
  10. Apps that use the External Accessory framework to communicate with external accessories can now ask to be woken up if the app is suspended when its accessory delivers new data. Including the UIBackgroundModes key  
  11.  with the external-accessory value in your app’s Info.plist file keeps your accessory sessions  
  12.  open even when your app is suspended. (Prior to iOS 5, these sessions were closed automatically at suspend time.) When new data arrives for a given session, a suspended app is woken up and given time to process the new data. This type of behavior is designed  
  13.  for apps that work with heart-rate monitors and other types of accessories that need to deliver data at regular intervals.  
  14.   
  15.   
  16.   
  17. For more information about the UIBackgroundModes key, see Information  
  18.  Property List Key Reference. For information about interacting with external accessories, see External  
  19.  Accessory Programming Topics.  
  20.   
  21.   
  22.   
  23.   
  24. Event Kit and Event Kit UI  
  25.   
  26.   
  27. The Event Kit framework (EventKit.framework) includes the following enhancements:  

    • The class hierarchy has been restructured. There is now a common base class called EKObject and portions of the EKEvent class have been moved into a new base class calledEKCalendarItem.

    • With the EKEventStore class, you can now create and delete calendars programmatically, fetch calendars based on their identifier, save and remove events in batches, and trigger a programmatic refresh of calendar data.

    • The new EKSource class represents the source for creating new calendars and events.

    • The EKCalendar class now provides access to a calendar’s UUID, source, and other attributes.

查看文本打印
  1. The Event Kit UI framework (EventKitUI.framework) now includes the EKCalendarChooser class,  
  2.  which provides a standard way for selecting from the user’s iCal calendars.  
  3.   
  4.   
  5.   
  6. For information about the classes of the Event Kit framework, see Event  
  7.  Kit Framework Reference. For information about the classes of the Event Kit UI framework, see Event  
  8.  Kit UI Framework Reference.  
  9.   
  10.   
  11.   
  12.   
  13. Core Motion  
  14.   
  15.   
  16. The Core Motion framework (CoreMotion.framework) now supports reporting heading information and magnetometer data for devices  
  17.  that have the corresponding hardware.  
  18.   
  19.   
  20.   
  21. For information about the classes of the Core Motion framework, see Core  
  22.  Motion Framework Reference.  
  23.   
  24.   
  25.   
  26.   
  27. Core Location  
  28.   
  29.   
  30. The Core Location framework (CoreLocation.framework) now includes support for both forward and reverse geocoding location data.  
  31.  This support allows you to convert back and forth between a set of map coordinates and information about the street, city, country (and so on) at that coordinate.  
  32.   
  33.   
  34.   
  35. For information about the classes of the Core Location framework, see Core  
  36.  Location Framework Reference.  
  37.   
  38.   
  39.   
  40.   
  41. Core Graphics  
  42.   
  43.   
  44. The Core Graphics framework (CoreGraphics.framework) includes some new interfaces to support the creation of paths. Specifically,  
  45.  there are new interfaces for creating paths with an ellipse or rectangle and for adding arcs to existing paths.  
  46.   
  47.   
  48.   
  49. For more information about the Core Graphics interfaces, see Core  
  50.  Graphics Framework Reference.  
  51.   
  52.   
  53.   
  54.   
  55. Core Data  
  56.   
  57.   
  58. The Core Data framework includes the following enhancements:  
查看文本打印
  1. The Event Kit UI framework (EventKitUI.framework) now includes the EKCalendarChooser class,  
  2.  which provides a standard way for selecting from the user’s iCal calendars.  
  3.   
  4.   
  5.   
  6. For information about the classes of the Event Kit framework, see Event  
  7.  Kit Framework Reference. For information about the classes of the Event Kit UI framework, see Event  
  8.  Kit UI Framework Reference.  
  9.   
  10.   
  11.   
  12.   
  13. Core Motion  
  14.   
  15.   
  16. The Core Motion framework (CoreMotion.framework) now supports reporting heading information and magnetometer data for devices  
  17.  that have the corresponding hardware.  
  18.   
  19.   
  20.   
  21. For information about the classes of the Core Motion framework, see Core  
  22.  Motion Framework Reference.  
  23.   
  24.   
  25.   
  26.   
  27. Core Location  
  28.   
  29.   
  30. The Core Location framework (CoreLocation.framework) now includes support for both forward and reverse geocoding location data.  
  31.  This support allows you to convert back and forth between a set of map coordinates and information about the street, city, country (and so on) at that coordinate.  
  32.   
  33.   
  34.   
  35. For information about the classes of the Core Location framework, see Core  
  36.  Location Framework Reference.  
  37.   
  38.   
  39.   
  40.   
  41. Core Graphics  
  42.   
  43.   
  44. The Core Graphics framework (CoreGraphics.framework) includes some new interfaces to support the creation of paths. Specifically,  
  45.  there are new interfaces for creating paths with an ellipse or rectangle and for adding arcs to existing paths.  
  46.   
  47.   
  48.   
  49. For more information about the Core Graphics interfaces, see Core  
  50.  Graphics Framework Reference.  
  51.   
  52.   
  53.   
  54.   
  55. Core Data  
  56.   
  57.   
  58. The Core Data framework includes the following enhancements:  

    • Core Data provides integration with the iOS document architecture and iCloud storage. The UIManagedDocument class is a concrete subclass of UIDocument that uses a Core Data persistent store for document data storage.

    • For apps built for iOS 5.0 or later, persistent stores now store data by default in an encrypted format on disk. The default protection level prevents access to the data until after the user unlocks the device for the first time. You can change the protection level by assigning a custom value to the NSPersistentStoreFileProtectionKey key when configuring your persistent stores. For additional information about the data protection that are new in iOS 5.0, see “Data Protection Improvements.”

    • Core Data formalizes the concurrency model for the NSManagedObjectContext class with new options. When you create a context, you can specify the concurrency pattern to use with it: thread confinement, a private dispatch queue, or the main dispatch queue. The NSConfinementConcurrencyType option provides the same behavior that was present on versions of iOS prior to 5.0 and is the default. When sending messages to a context created with a queue association, you must use the performBlock: orperformBlockAndWait: method if your code is not already executing on that queue (for the main queue type) or within the scope of a performBlock... invocation (for the private queue type). Within the blocks passed to those methods, you can use the methods of NSManagedObjectContext freely. The performBlockAndWait: method supports API reentrancy. The performBlock: method includes an autorelease pool and calls the processPendingChanges method upon completion.

    • You can create nested managed object contexts, in which the parent object store of a context is another managed object context rather than the persistent store coordinator. This means that fetch and save operations are mediated by the parent context instead of by a coordinator. This pattern has a number of usage scenarios, including performing background operations on a second thread or queue and managing discardable edits, such as in an inspector window or view

    • Nested contexts make it more important than ever that you adopt the “pass the baton” approach of accessing a context (by passing a context from one view controller to the next) rather than retrieving it directly from the app delegate.
    • Managed objects support two significant new features: ordered relationships, and external storage for attribute values. If you specify that the value of a managed object attribute may be stored as an external record, Core Data heuristically decides on a per-value basis whether it should save the data directly in the database or store a URI to a separate file that it manages for you.
    • There are two new classes, NSIncrementalStore and NSIncrementalStoreNode, that you can use to implement support for nonatomic persistent stores. The store does not have to be a relational database—for example, you could use a web service as the back end.

For more details about the new features in Core Data, see Core Data Release Notes for OS X v10.7 and iOS 5.0.

Core Audio

The Core Audio family of frameworks includes the following changes in iOS 5.0:

    • Audio-session routing information is now specified using dictionary keys. There are also new modes for managing your app’s audio behavior:

      • Voice chat mode optimizes the system for two-way voice conversation.

      • Video recording mode configures the device for video capture.

      • Measurement mode disables automatic compression and limiting for audio input.

      • Default mode provides iOS 4.3.3 behavior.

    • Core Audio adds seven new audio units for handling advanced audio processing features in your app, such as reverb, adjustable equalization, and time compression and stretching. The new Sampler unit lets you create music instruments, for which you can provide your own sounds. The new AUFilePlayer unit lets you play sound files and feed them directly to other audio units.

    • The 3D Mixer audio unit is enhanced in iOS 5.0 to provide reverb and other effects useful in game audio.

    • You can automate audio unit parameters in an audio processing graph, which lets you build a music mixer that remembers fader positions and changes.

    • You can now use the advanced features of Apple Core Audio Format files in iOS. For example, you might create new voices for the Sampler audio unit.

    • There is now programmatic support for adjusting the audio input gain.

    • Core Audio now supports 32-bit floating-point audio data for apps that need to provide high quality audio.

For information about the audio technologies available in iOS, see Multimedia Programming Guide. For information about the new audio units, see Audio Unit Component Services Reference.

AV Foundation

The AV Foundation framework includes the following enhancements:

    • There is automatic support for playing audio and video content over AirPlay. Apps can opt out of transmitting video over AirPlay using the allowsAirPlayVideo property of theAVPlayer class.

    • New properties on the AVPlayerItem class indicate whether the item supports fast-forwarding or rewinding of the content.

For information about the classes of the AV Foundation framework, see AV Foundation Framework Reference.

Assets Library

The Assets Library framework includes the following enhancements:

    • Support for accessing photo streams

    • Support for creating new albums in the user’s photo library

    • Support for adding assets to albums

    • The ability to get an aspect ratio thumbnail for an asset

    • The ability to modify saved assets

查看文本打印
  1. For information about the classes of the Assets Library framework, see Assets  
  2.  Library Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Address Book  
  8.   
  9.   
  10. The Address Book framework adds support for importing and exporting vCard data. It also adds new keys to associate social network affiliations with a user record.  
  11.   
  12.   
  13.   
  14. For more information about the new features in the Address Book framework, see Address  
  15.  Book Framework Reference for iOS.  
  16.   
  17.   
  18.   
  19.   
  20. Security  
  21.   
  22.   
  23. The Security framework (Security.framework) now includes the Secure Transport interfaces, which are Apple’s implementation of  
  24.  the SSL/TLS protocols. You can use these interfaces to configure and manage SSL sessions, manage ciphers, and manage certificates.  
  25.   
  26.   
  27.   
  28. For information about the Secure Transport interfaces, see the SecureTransport.h header file of the Security framework.  
查看文本打印
  1. For information about the classes of the Assets Library framework, see Assets  
  2.  Library Framework Reference.  
  3.   
  4.   
  5.   
  6.   
  7. Address Book  
  8.   
  9.   
  10. The Address Book framework adds support for importing and exporting vCard data. It also adds new keys to associate social network affiliations with a user record.  
  11.   
  12.   
  13.   
  14. For more information about the new features in the Address Book framework, see Address  
  15.  Book Framework Reference for iOS.  
  16.   
  17.   
  18.   
  19.   
  20. Security  
  21.   
  22.   
  23. The Security framework (Security.framework) now includes the Secure Transport interfaces, which are Apple’s implementation of  
  24.  the SSL/TLS protocols. You can use these interfaces to configure and manage SSL sessions, manage ciphers, and manage certificates.  
  25.   
  26.   
  27.   
  28. For information about the Secure Transport interfaces, see the SecureTransport.h header file of the Security framework.  


  • iOS 4.3
  • iOS 4.2
  • iOS 4.1
  • iOS 4.0
  • Document Revision History

本文转载自:http://www.verydemo.com/demo_c140_i1023.html

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 没有享受到国家政策的农民怎么办? 股票涨了没抛然后一直跌怎么办 苹果手机放久了开不了机怎么办 部门要辞退你你不想走该怎么办 口头说辞职现在又不想走了怎么办 网上买的理财不给退本金怎么办 买东西遇到态度不好的人你会怎么办 app在下载东西时被停用了怎么办 买东西填错地址 但已签收怎么办 网购手机受骗后电话打不通怎么办 淘宝买的东西发错了怎么办 淘宝上买的东西发错了怎么办 淘宝上买的东西发多了怎么办 淘宝上买的东西出现问题怎么办 淘宝买东西未收到货显示签收怎么办 网上一张车票两人同时付款了怎么办 微信付款时显示银行卡被锁定怎么办 微信忘记支付密码怎么办没有银行卡 支付宝赏金扫码支付不行怎么办 网购收货时发现货物已破损怎么办 货物丢失了不承认调查出来了怎么办 小米商城已签收未收到了怎么办 网购的一只荷兰猪现在怎么办 中通快递的掌中通好评怎么办 唯品会快递被签收却没收到货怎么办 拼多多快递签收了但没收到货怎么办 顺丰代收签收成功要强制退款怎么办 淘宝付了钱如果商家没货了怎么办 别人拿走我的货不给钱怎么办 快递出途中损坏签单后才发现怎么办 顾客支付宝少付了钱人走了怎么办 顾客通过收钱码付的钱少了怎么办 寄顺丰快递收件人号码填错了怎么办 京东退货售后说是有划痕怎么办 手机上快递员软件签收错了怎么办 苹果手机进网许可证丢了怎么办 作废的普票发票联丢失怎么办 想退换货但是发票丢了怎么办 快递没有当面验货造成的丢件怎么办 退货卖家收货验货说有问题怎么办 没当着快递人员面验货少货怎么办