精华内容
下载资源
问答
  • 五年级英语上册 Lesson 9 What's the date today(1) 陕旅版.doc
  • 五年级英语上册 Lesson 9 What's the date today (3) 陕旅版.doc
  • 五年级英语上册 Lesson 9 What's the date today (2) 陕旅版.doc
  • tape expiry is for the physical media. Think of it as shelf life. If you have a new tape and you do not want to use it after it is 3 years old then set the tape expiry to 3 years. After 3 years NetBac

    tape expiry is for the physical media. Think of it as shelf life. If you have a new tape and you do not want to use it after it is 3 years old then set the tape expiry to 3 years. After 3 years NetBackup will no longer write to it. Images that are on it may or may not have expired. If they have not expired then they can still be used for a restore.

    Image retention is how long the image written to the tape can be used to do a restore.

    if you have a tape that has a 3 year tape expiry and an image on it with a 7 year retention then the tape will no longer be able to be written to after 3 years and the image can no longer be used for a restore after 7 years.

     

    "Data expiration [or image expiration]: the date when the backups [images] on the volume [tape] expire"

    "Volume expiration [or tape expiration]: Indicates the age of the volume [tape]. If the volume expiration date is reached, the volume is considered too old to be reliable and no further mounts in write mode are allowed. NetBackup can mount the volume in read mode but writes a message to the system application log that the expiration date has been reached. If the column is blank, the volume has no expiration date.Note: This is the expiration date for the media itself not the expiration of any images stored on the media

     

    bpexpdate — change expiration date of backups in image catalog and media in media catalog

    bpexpdate -mmedia_id -ddate | 0 | infinity [-hostname] [-force] [-nodelete] [-notimmediate] [-Mmaster_server,...]

    DESCRIPTION

    NetBackup maintains catalogs, which are internal databases with backup image and media information. The image record in the image catalog contains an expiration date. The media ID in the media catalog also contains an expiration date. The expiration date is the date and time when NetBackup removes the record for a backup or a media ID from the corresponding catalog.

    The bpexpdate command allows the expiration date and time of backups to be changed in the NetBackup image catalog. The command is also used to change the expiration of removable media in the NetBackup media catalog. If the date is set to zero, bpexpdate immediately expires backups from the image catalog or media from the media catalog. When a media ID is removed from the NetBackup media catalog, it is also removed from the Enterprise Media Manager Database. It is removed regardless of the media's previous state (FROZEN, SUSPENDED, and so on).

    You can change the expiration on a media ID basis or on an individual backup ID basis. When you change the expiration date of a media ID, the expiration date of all backups on the media are also changed.bpexpdate also provides the following options:

    • Remove media from the media catalog if they no longer contain valid backups.

    • Recalculate the expiration date to base it on the configured or a supplied retention level.

    Any authorized user can run this command.

    For more information about NetBackup authorization, refer to theNetBackup Security and Encryption Guide.

    OPTIONS

    The different formats of the command are as follows:

    -backupid

    Changes the expiration of a single backup. If the date is zero, the backup is removed from the image catalog. If the backup is on removable media and the-d expiration is greater than the current media ID expiration, the media catalog expiration also changes. The change affects all copies of a backup, unless the-copy option is used. The-copy option causes only the specified copy to be affected.

    -deassignempty

    Searches the catalog for the removable media that no longer contain valid backups. It removes the media from the media catalog and removes the media IDs in the Media Manager catalog. The media is then available to use again. You can use the NetBackup Images on Media report to determine if the assigned media no longer contain valid backups.

    -m

    Changes the expiration date or removes the media ID from the media catalog and associated backups from the NetBackup catalog. A separate expiration date is maintained in the image catalog for each copy of a backup. When this format is used, only the expiration of the copy on the media is affected. If you remove the media ID from the media catalog by specifying a zero date, you also remove it in the Enterprise Media Manager Database.

    -recalculate

    Allows the expiration date of backups to be changed based on the specified retention level, or you can specify a new expiration date. When the expiration changes according to retention level, the new date is based on the creation date of the backup plus the retention level value. The expiration can be changed for a single backup, or for all backups for a particular client, policy, or schedule type.

    If the backup is on removable media, the expiration in the media catalog changes if the command expiration is greater than the current expiration.

    -stype server_type

    A string that identifies the storage server type. Possible values are AdvancedDisk, OpenStorage (vendorname), and PureDisk.

    OPTIONS

    -clientname

    Specifies the client name for the-backupid and-recalculate operations.

    For the backupid operation, this option causes NetBackup to first search for the backup ID for the specified client. This option is useful if the client name has changed.

    For recalculate, this option causes NetBackup to recalculate the expiration date to be based on the retention level for all the specified client backups.

    -copy number

    Expires or changes the expiration date of the specified copy number and is valid only with the-backupid and-recalculate options. Valid values are1 through 10.

    If the primary copy is expired, the other copy becomes the primary copy. If this option is not specified, the expiration affects both copies of the backup.

    -d date

    Specifies the expiration date and time. date can be any one of the following:

    • mm/dd/yy hh:mm:ss

    • 0 - the backup or media expires immediately

    • infinity - the backup never expires

    The required date and time values format in NetBackup commands varies according to your locale. The/user/openv/msg/.conf file (UNIX and Linux) and theinstall_path\VERITAS\msg\LC.CONFfile (Windows) contain information such as the date-time formats for each supported locale. The files contain specific instructions on how to add or modify the list of supported locales and formats.

    More information is available about the locale of your system.

    See the "Specifying the locale of the NetBackup installation" topic in theNetBackup Administrator's Guide, Volume II.

    -deassignempty

    Expires the removable media from the media catalog when that media no longer contain valid backups. It also deassigns the media ID in the Media Manager catalog.

    -dp disk_pool_name -dv disk_volume

    Specifies the disk pool and, optionally, the disk volume for the expiration date operation to be performed.

    -force

    Before you run the specified operation,bpexpdate queries before it starts the operation. This option forces thebpexpdate command to carry out the operation without querying the user.

    -host name

    Note:

    For the NetBackup server, this option is not required because only one server (the master) exists. If you do use the option, specify the host name of that server.

    Specifies the host name of the server to which the media is assigned. This option should be used only with the-mmedia_id option, and then only if the following is true: The master has remote media servers and the volume was not written on the server where you runbpexpdate.

    For example, assume that you have   a master server named whale and a media server named eel. You run the following command on whale to remove media ID BU0001 manually from the media catalog and all corresponding backups from the image catalog:

    bpexpdate -m BU0001 -d 0 -host eel

    You can use the NetBackup Media List report to determine which server's media catalog has the volume.

    -m media_id

    Specifies the media ID that the expiration date change affects. The expiration dates of the backups on the media ID also change. The-d option must be included with this option.

    This option can also be used when the -deassignempty option is specified to check if valid backups exist on this particular media ID. In this case, do not include the-d option.

    The media ID must be six or fewer characters and must be in the NetBackup media catalog.

    -M master_server [,...]

    Specifies the master server that manages the media catalog that has the media ID. If this option is not specified, the default is one of the following: For NetBackup server :

    NetBackup server  supports only one server (the master) with no remote media servers. Therefore, the default in this case is always the master server where you run the command.

    For NetBackup Enterprise Server:

    If the command is run on a master server, then that server is the default. If the command is run on a media server that is not the master, then the master for that media server is the default.

    -nodelete

    Deletes the backup from the image catalog but does not delete it from the disk storage. Use this option when you unimport a disk group from one master server and import the disk group to a different master server.

    -notimmediate

    Inhibits the call that bpexpdate makes to thenbdelete command after it expires an image on disk. If you intend to delete many images at the same time, use-notimmediate to avoid the overhead of multiple job creation fornbdelete to process. You can then run thenbdelete command later.

    -policy name

    Specifies the policy name and is valid with the-recalculate option. When the policy name is specified, the expiration is recalculated based on the retention level for all backups that are created in this policy.

    -recalculate

    Recalculates the expiration of backups that are based on the retention level or you can specify a new expiration date. You can include other options to change the expiration for a single backup, or for the following: All backups for a specific client name, policy name, or schedule type. Either the-d or-ret option must be specified with this option.

    -ret retention_level

    Specifies the retention level to use when you recalculate expiration dates and is valid with the-recalculate option. Levels range from 0 to 24. The new expiration date is the backup's creation date plus this retention level. You must specify either-backupid or-policy with this option.

    -sched type

    Specifies the schedule type and is valid with the-recalculate option. When the type is specified, the expiration is recalculated based on the retention level for all backups that are created with this schedule type. Enter a numeric value for type as follows:

    0 = Full

    1 = Differential Incremental

    2 = User Backup

    3 = User Archive

    4 = Cumulative Incremental

    The -policy option must be specified with-sched.

    NOTES

    Some options in large environments can take a significant amount of time to complete. Changes that cause backups or media to expire are irrevocable. You may be required to import backups or recover previous versions of the catalogs if you make mistakes by using this command.

    EXAMPLES

    Example 1 - The following command runs on the master server and removes media ID BU0002 from the media catalog. It deassigns the media ID in the media manager catalog. It also expires associated image records in the image catalog.

    # bpexpdate -m BU0002 -d 0

    Example 2 - Change the expiration of copy 2 of backupid eel_0904219764. It does not affect the expiration of copy 1 of the backup.

    # bpexpdate -backupid eel_0904219764 -d 12/20/2010 08:00:00 -copy 2

    Example 3 - Remove the backup from the image catalog. Since the-copy option is not specified, all copies are removed.

    # bpexpdate -backupid eel_0904219764 -d 0

    Example 4 - Check for media in the media catalog of hostcat that is still assigned, but no longer contain valid backups. The command removes any such media from the catalog and deassigns them in the media manager catalog.

    # bpexpdate -deassignempty -host cat

    Example 5 - Recalculate the expiration date of backup ID 1234 to the date 10/31/2010.

    # bpexpdate -recalculate -backupid 1234 -d 10/31/10

    Example 6 - Recalculate the expiration date of backup ID 1234 based on a retention level. The new retention level is 4 which is two months (default value). Backup ID 1234 is now scheduled to expire in 2 months.

    # bpexpdate -recalculate -backupid 1234 -ret 4 

     

     

    -------------------------------------------------------------

    Netbackup tips

     

    Starting and Stopping Netbackup

    Stopping Netbackup

    • /usr/openv/netbackup/bin/K77netbackup    --> graceful shutdown
    • /usr/openv/netbackup/bin/bpps -a   --> check for any remaining processes
    • /usr/openv/netbackup/bin/goodies/bp.kill_all   --->  kills all remaining netbackup processes, not necessarily graceful
    • /usr/openv/netbackup/bin/bpps -a   --> check for any remaining processes
    • kill -9 <pid>  for any remaining.   NOTE:  unkillable processes may require a reboot

    Starting Netbackup

    • /usr/openv/netbackup/bin/S77netbackup  --> after bp.kill_all, to restart

     

    Common Tasks

    Starting the Administration GUI

    • java from the windows client
    • x-windows from the server - /usr/openv/netbackup/bin/xnb &

    Checking Backup Status

    • Activity Monitor or
    • /usr/openv/netbackup/bin/admincmd/bpdbjobs -report

    Cleaning a tape manually

    • Identify the drive name to be cleaned
      • tpclean -L
    • Manually clean the drive:
      • tpclean -C <drive name>

    Determining what tapes were used for a backup

    • GUI
      • Backup and Restore --> Find the file system --> Preview Media Button
    • CLI
      • Find the correct backup images
        • bpimagelist -U -client <CLIENT> -d <STARTDATE> -e <ENDDATE>
      • Find the media used for those images
        • bpimagelist -U -client <CLIENT> -d <STARTDATE> -e <ENDDATE> -media

    Listing the files in a backup

    Find the tape(s) used (above procedure using bpimagelist)
    cd /usr/openv/netbackup/db/jobs/done
    Run the following script and redirect it's output to a text file:
            for file in `grep MOUNTING *|grep <MEDIA_ID>|awk '{print $1}'|sed 's/:MOUNTING//'`
            do
            echo $file
             grep PATH_WRITTEN $file|awk '{print $3}'
            echo " "
            echo "==========================================End of Image======================================"
            echo " "
            done


    This process works for NBU V3.4:

    • cd /usr/openv/netbackup/db/images/<CLIENT>
    • ls -ltr  -->  this will identify the directory with the proper date
    • verify directory with "bpdbm -ctime <Unixtime>
    • cd <Unixtime>
    • ls -ltr --> lists all of the backups for this client on this date
    • cat <POLICY>_<Unixtime>_<BU Type>.f | awk '{print $10}'  --> this prints out the files in the backup


    For NBU > V3.4

    • bpflist  --help   --> undocumented netbackup command to list files from a binary .f file



    Inventory the Robot

    • Inventory Robot  -->  /opt/openv/volmgr/bin/vmcheckxxx -rt robot_type -rn robot_number -list  (where robot_type is tld, acs, . . .)
    • Inventory Robot and Update Configuration -->  /opt/openv/volmgr/bin/vmupdate -rt robot_type -rn robot_number -list  (where robot_type is tld, acs, . . .)

    Listing Properties of the Volume Pools

    • vmpool -listall

    Scratch Tapes

    • Count scratch tapes:  /usr/openv/volmgr/bin/vmquery -pn Scratch | grep -c "robot slot"
    • Moving tapes to the scratch pool
      • If Needed - Expire the tape
        • bpexpdate -ev <TAPE ID> -d 0 -force -host <Media Manager>
      • Move the tape
        • vmchange -p 2 -m <TAPE ID>

    Checking Drive Usage

    • /usr/openv/volmgr/bin/vmoprcmd

    Taking a drive down or up

    • /usr/openv/volmgr/vmoprcmd -down <drive index>
    • /usr/openv/volmgr/vmoprcmd -up <drive index>


    Performing a Restore

    • From the GUI
      • user backup & restore --> configuration --> client
      • user backup & restore --> configuration --> client to restore
      • directory to search
      • directory depth
      • date range
      • file --> browse backups for restore

    Adding New Tapes to the Library

    • Using the GUI
      • Media Management --> Actions --> New --> Single Volume . .  -->
      • Media Type (ie DLT)
      • Robot Type (ie TLD)
      • Media ID (from Inventory)
      • Slot Number (from Inventory)
      • Robot Number (ie 0)
      • Volume Group
      • Volume Pool (ie Scratch)
    • Using the CLI
      • vmadd -m <media id> -mt <tape type> -verbose -rt <robot type> -b <barcode> -rn <robot number> -rc1 <slot> -p <pool number> -mm <max mounts>
        • vmpool -listall  --> lists all pools, both name and number
      • For example:  vmadd -m 000151 -mt dlt -verbose -rt tld -b 000151 -rn 0 -rc1 8 -p 2 -mm 0

    Re-using Tapes from other systems or older Netbackups

    • Expire the media
      • bpexpdate -ev MEDIA_ID -d 0 -force -host HOST
    • Deassign the media
      • vmquery -deassignbyid MEDIA_ID 4 0
    • Move to the scratch pool
      • vmchange -m MEDIA_ID -p POOL#
    • Relabel the media
      • bplabel -ev CIM572 -d dlt -p Scratch

    Changing the attributes of media

    • Changing the barcode
      • vmchange -barcode CYM100D -m CYM100
    • Changing the Volume Pool
      • vmchange -m MEDIA_ID -p POOL#


    To expire media

    • bpexpdate -ev <medai id> -d 0 -force -host <media server>

      To unfreeze media

      • List the frozen media
        • /usr/openv/netbackup/bin/goodies/available_media | grep -i FROZEN
      • Unfreeze the media
        • bpmedia -unfreeze -ev <media id> -h <media server>

      To relabel a tape

      • bplabel -ev <media id> -d <tape density> -p <pool name>
      • bplabel -ev 000687 -d dlt -p TriVrgt_OFFSITE

      To remove media from the Netbackup database

      • Verify that there are no images on the tape
        • bpimmedia -mediaid 000687 -L
      • Expire the tape
        • bpexpdate -ev 000687 -d 0 -host scorpius -force
      • Get the status and pool number of the tape
        • vmquery -m 000687
      • Deassign the tape
        • vmquery -deassignbyid <media id> <pool number> <status code from vmquery -m>
        • vmquery -deassignbyid 000687 4 0x0
      • Delete the tape
        • vmdelete -m 000687


      Installing the Netbackup Client

      • /update_clients -ForceInstall -ClientList /tmp/clients.lst
        • requires that TMPDIR and TEMPDIR be set correctly

      Excludng files from backup on a client

      • Create /usr/openv/netbackup/exclude_list
      • Put the file specifications of the files/directories to be excluded
        • /mnt/directory/*

      Displaying Information about a Tape

      • vmquery -m <media id>   --> Displays attributes about a particular tape
      • bpmedialist -U -mcontents -ev 000687   --> Displays media contents
      • bpmedialist -U -mlist  --> List of all media
      • bpmedialist -U -mlist -ev CYM966  --> Listing of a particular media id
      • bpimmedia -mediaid 000687 -L   --> Listing of images on a tape

      Robtest Commands

      • Starting robtest
        • robtest
        • 1  --> to select TLD 0
      • Getting help
        • ?
      • Looking at contents of the tape drives
        • s d
      • Looking at the contents of the library
        • s s
      • Moving a tape from a drive to a library slot
        • s d  --> to identify drive number that has tape (Contains Cartridge = yes, Barcode=XXXXXX)
        • s s  --> to identify an empty slot in the tape library (Netbackup will need to be re-inventoried)
        • m d# s#  --> from from drive # to slot #
        • s d  --> verify the tape drive is empty
        • s s --> verify the library slot has the tape



       

      Configuration Files

      /usr/openv/netbackup/bp.conf

      • configuration file, sets backup server and backup clients
      • force statement must be correct
      • client to browse from
      • client to restore to

      /usr/openv/volmgr/vmconf

      Logfiles

      To utilize logfiles, create the corresponding directory in /usr/openv/netbackup/logs

      Server Logfile directories:

      • admin - adminstrative commands
      • bpbrm - backup and restore manager
      • bpcd - client daemon
      • bpdbjobs - database manager program process
      • bpdm - disk manager process
      • bpjava-msvc - Java application server authentication service
      • bpjava-usvc - process that services Java requests
      • bprd - request daemon process
      • bpsched - scheduler process that runs on master servers
      • bptm - tape/optical media management process
      • user-ops - required directory for use by Java programs
      • xbpadm - X based administration utility
      • xbpmon - X based job monitor process

      Client Logfile directories:

      • bp - client user interface process
      • bparchive - archive program
      • bpbackup - backup program
      • bpbkar - program that generates golden images
      • bpcd - client daemon
      • bpjava-msvc - Java application server authentication service
      • bpjava-usvc - process that services Java requests
      • bplist - program that lists backed up and archived files
      • bpmount - program that determines local mountpoints  and wildcard expansion for multiple streams
      • bphdb - Oracle database backup program start process
      • db_log - database specific extension log
      • tar - tar process log during restores
      • user_ops

      Media Manager logging automatically goes to the system log using syslogd logging facility

        .Logging will only occur if these directories are created.  These directories will generate a lot of data and should be deleted when no longer necessary.

        To increase the amount of logging information set VERBOSE=2 in /usr/open/netbackup/bp.conf  (default is VERBOSE=1)

        Processes

        ltid
        acsd
        vmd


        Useful Commands


        bpcllist - list classes
        bpclinfo <class> -L   --> displays info about a class
        vmpool - volume pools
        vmpool -listall
        vmpool -listscratch
        bplabel -ev <media id> -d hcart
        bpbackup db  --> backs up the catalog
        bpclclients <policy>  --> lists the clients for a particular policy (class)

        Troubleshooting

        bperror -statuscode   <-- displays information about the  netbackup error.

        No Backups are running:

        • Check system log file for error messages
        • Stop and restart all the netbackup processes
        • Look for a downed drive
          • /usr/openv/volmgr/bin/vmoprcmd
          • /usr/openv/volmgr/bin/vmoprcmd -up 0   --> this will bring up drive 0 if it's control shows as down
        • Look for pending requests
          • /usr/openv/volmgr/bin/vmoprcmd or gui --> device management
          • If there is a pending request either re-assign it to a drive, or deny the request

        Downed drive does not come back up or does not stay up

        • Check for a hardware problem by looking for messages on the tape library
        • Make sure there is not a tape stuck in the drive
          • Use robtest (described above) to look at the drives
            • If there is a tape stuck in the drive, try to remove it using robtest
            • If robtest fails, then you must manually remove it.

        Verify the Client is communicating properly:

        • bpclncmd -ip  <ip address>  --> from both client and server
        • bpclntcmd -hn <hostname>  --> from both client and server
        • bpclntcmd -pn    -->  from client only


         

        Device Actions

        Device Management --> info about tape drives

        • dlt
        • hcart (ultrium)

        Media Actions

        Media id must agree with # of the tape
        Create a media id

        • actions -->new-->single volume-->dlt cart (not dlt2)
        • put it into the "netbackup" volume pool

        Netbackup Client


        To check things out do this:

        It could be a couple things.  Mostly DNS, bp.conf, or something stupid.  On
        the client run this command

        /usr/openv/netbackup/bin/bpclntcmd -pn

        /usr/openv/netbackup/bin/bpclntcmd -server "server name"

        /usr/openv/netbackup/bin/bpclntcmd ip "ip_address"

        -----------------------------------------


        tpclean” Command

        Runing the “tpclean –L” command from the master server will provide the information regarding whether or not a drive needs cleaning and what the accumulated mount time is. In the following example you can see that drive  IBM.ULTRIUM-TD3.008     needs cleaning. It should be automatically cleaned after 360 hours of accumulated mount time but as you can see it still has not been cleaned. The issue may be there are no appropriate cleaning tapes in the library or there are zero remaining cleanings. Correcting this situation will result in the drive being automatically cleaned.

        bash-2.05$ sudo ./tpclean -L

        Password:

        Drive Name              Type      Mount Time  Frequency   Last Cleaned         Comment

        **********              ****      **********  *********   ****************     *******

        IBM.ULTRIUM-TD3.006     hcart3*   315.9       360         08:55 06/07/2011

        IBM.ULTRIUM-TD3.007     hcart3*   0.0         360         11:53 06/28/2011

        IBM.ULTRIUM-TD3.008     hcart3*   526.4       360         17:14 05/21/2011     NEEDS CLEANING

        ----------------------------------

        netbackup commands

         

        NetBackup Command Guide

        Submitted by Igor on December 27, 2009 – 7:17 pm 4 Comments

        NetBackup is an enterprise-level distributed backup and recovery application. The environment consists of the master server, media server, storage library, networking hardware, and client agents. NetBackup supports a wide variety of Unix, Linux, VMS, and Windows systems. The original backup solution was developed by Control Data Corp., later acquired by Openvision, which gave the product its “NetBackup” name. NetBackup was then bought by Veritas and is currently owned and supported (poorly) by Symantec.

        Daemons and Processes

        On the master server there are four NetBackup daemons started in sequence:

        1. bprd – the request daemon started during system boot
        2. bpsched – the scheduler daemon started by bprd
        3. bpdbm – the NetBackup database manager started by bpsched
        4. bpjobd – the job monitor daemon started by bpdbm

        One the media server, there are up to nine NetBackup daemons:

        1. bpcd – communications daemon started during system boot
        2. bpbrm - backup and restore manager started by bpcd
        3. bptm - tape manager started by bpbrm
        4. bpdm - disk manager started by bpbrm
        5. ltid - media manager started during system boot
        6. avrd - bar code reader daemon started by ltid
        7. vmd - volume manager daemon started by ltid
        8. tldd - robotic tape library daemon started by ltid
        9. tldcd - robotic tape library control daemon started by ltid

        One the client side, there is one NetBackup daemon started during system boot:

        1. bpcd – the client daemon, which starts the bpbkar processes for each active backup or restore job

        Logs and Configuration Files

        Version and patch levels

        1. NetBackup and patch versions: /opt/openv/netbackup/bin/version
        2. Patch level history: /opt/openv/netbackup/patch/patch.history
        3. Media version: /opt/openv/volmgr/version

        Configuration Files

        1. NetBackup configuration: /opt/openv/netbackup/bp.conf
        2. Media manager configuration: /opt/openv/volmgr/vm.conf
        3. Buffer size: /opt/openv/netbackup/db/config/SIZE_DATA_BUFFERS
        4. Number of buffers: /opt/openv/netbackup/db/config/NUMBER_DATA_BUFFERS
        5. Network buffer size: /opt/openv/netbackup/NET_BUFFER_SZ (default is 32)
        6. Catalog type: /opt/openv/netbackup/db/config/cat_format.cfg

        Access control

        1. Java GUI authorization: /opt/openv/java/auth.conf

        Troubleshooting

        1. Corrupt database images: /opt/openv/netbackup/db.corrupt

        (The following is the corrected and expanded information found at http://www.datadisk.co.uk/html_docs/veritas/veritas_netbackup_cs.htm)

        Server Commands

        Check license details/opt/openv/netbackup/bin/admincmd/get_license_key
        Start Netbackupnetbackup start

        /opt/openv/netbackup/bin/initbprd  (master)
        /opt/openv/volmgr/bin/vmd (media)

        Stop Netbackup (does not disconnect GUI sessions)netbackup stop

        /opt/openv/netbackup/bin/admincmd/bprdreq -terminate  (master)
        /opt/openv/netbackup/bin/bpdbm -terminate (master)

        Stop Netbackup and kill all GUI sessions/opt/openv/netbackup/bin/goodies/bp.kill_all
        Start the GUI/opt/openv/netbackup/bin/jnbSA
        Scan for tape devicessgscan (solaris)
        ioscan (HPUX)
        Display all Netbackup processesbpps -a
        lists servers errors

        bperror -U -problems -hoursago
        bperror -U -backstat -by_statcode -hoursago

        display information on a error codebperror -statuscode [-recommendation]
        Reread bp.conf file without stopping Netbackupbprdreq -rereadconfig
        Check database consistencybpdbm -consistency 1
        bpdbm -consistency 2

        Check for the below lines:
        Bad image header
        Does not  exist

        Netbackup Recovery
        Device catalog is intactbprecover -l -m -d dlt  (listing)
        bprecover -r -m -d dlt (recovering)
        Device catalog is gone or corruptedbprecover -l -tpath (listing)
        bprecover  -r -tpath (recovering)
        Disk backupsbprecover -l -dpath (listing)
        bprecover  -r -dpath (recovering)

        Catalog Commands

        Master Server
        Information about backed-up filesimage – /opt/openv/netbackup/db
        Storage Unit, Global Configuration, Catalog backup configuration.config – /opt/openv/netbackup/db
        Backup Policy informationclass – /opt/openv/netbackup/db
        Job status informationjobs – /opt/openv/netbackup/db
        Netbackup logs with error and status informationerror – /opt/openv/netbackup/db
        Information on volumes, volume pools, scratch pool and volume  groupsvolume – /opt/openv/volmgr/database
        Media Server
        Tracks assigned volumes (media that has data them)media – /opt/openv/netbackup/db
        Information about devices managed by the media serverdevice – /opt/openv/volmgr/database

        Volume Commands

        Tape Drive and Inventory Commands
        List drive status, detail drive info and pending requestsvmoprcmd
        List the tape drive statusvmoprcmd -d ds
        List the pending requestsvmoprcmd -d pr
        Control a tape devicevmoprcmd [-reset][-up][-down]
        List all changes in the robot(but do not update)vmupdate -recommend -rt tld -rn 0

        vmcheckxxx -rt tld -rn 0 -recommend

        Empty the robot and re-inventory (using barcodes)vmupdate -rt tld -rn -rh -vh -nostderr -use_barcode_rules -use_seed  -empty_ie
        Tape Media Commands
        List all poolsvmpool -listall -bx
        List tapes in poolvmquery -pn -bx
        List all tapes in the robotvmquery -rn 0 -bx |grep ‘TLD’ | sort +4
        List cleaning tapesvmquery -mt dlt_clean -bx
        List tape volume detailsvmquery -m
        Delete a volume from the catalogvmdelete -m
        Change a tapes expiry datevmchange -exp 12/31/06 23:59:58 -m
        Change a tape’s media poolvmchange -p -m

        Media Commands

        List the storage unitsbpstulist -U
        Freeze or unfreeze mediabpmedia [-freeze][-unfreeze] -ev
        List media detailsbpmedialist -ev
        List media contentsbpmedialist -U mcontents -m
        List backup Image Informationbpimagelist -backupid
        Expire client imagesbpimage -cleanup -allclients
        Expire a tapebpexpdate -d 0 -ev -force
        List all netbackups jobsbpdbjobs -report [-hoursago]
        Move media from one media server to anotherbpmedia -movedb -newserver   -oldserver

        Tape/Robotic Library Commands

        List tape drivestpconfig -d
        List cleaning times on drivestpclean -L
        clean a drivetpclean -C
        change a drives cleaning frequencytpclean -F
        set a drives cleaning time to zerotpclean -M
        Move tapes within robot using robtestrobtest

        commands that can be used are as follows:

        s s       (show slots)
        s  d       (show drives)
        s i       (show load port)
        m s250 d5 (move tape from  slot 250 into drive 5)
        uload d5  (unload tape from drive 5)
        m d5 s250  (move tape from drive 5 to slot 250)
        m s250 i1 (move tape from slot 250 to  load port 1)

        List load port tapesecho “s i q” | tldtest -r /dev/sg/c0t4l0
        List all slot contentsecho “s s q” | tldtest -r /dev/sg/c0t4l0
        List tape drive contentsecho “s d q” | tldtest -r /dev/sg/c0t4l0
        Move a tape in s100 to drive 1echo “m s100 d1″ | tldtest -r /dev/sg/c0t4l0
        Move a tape to load port 1echo “m s100 i1″ | tldtest -r /dev/sg/c0t4l0

        Archiving Commands

        list archive infobpcatlist -client all -before Jul 01 2006
        bpcatlist -client all -before  Aug 01 2006
        archive and remove imagesbpcatlist -before Jul 01 2006 | bpcatarc | bpcatrm
        restore archive filesbpcatlist -before Jul 01 2006 | bpcatres

        Client Commands

        test client connectivitybpclntcmd [-ip ]
        bpclntcmd [-hn  ]
        bpclntcmd [-pn]
        bpclntcmd [-sv]

         

         

        展开全文
      • [Scene: In a TV commercial that the gang is watching at Monica and Rachel's.] [A guy is sitting at his desk and his boss comes in and drops a huge pile of papers on his desk. The guy looks dejected.] ...

        [Scene: In a TV commercial that the gang is watching at Monica and Rachel's.]

        [A guy is sitting at his desk and his boss comes in and drops a huge pile of papers on his desk. The guy looks dejected.]

        COMMERCIAL VOICEOVER: Can't get the monkey off your back? Then put it in your mouth…

        [A monkey jumps on the desk and hands the guy a beer. He opens the beer and is suddenly on the beach, in a hammock, with beautiful women all around.]

        COMMERCIAL VOICEOVER: …With MonkeyShine Beer. [MonkeyShine theme] MonkeyShine Beer, 'cause it's a jungle out there.]

        [Camera pans back from the TV to show the gang watching.]

        ROSS: That commercial always makes me so sad.

        JOEY: Yeah, but then the guy opens his beer and those girls run at him, so, everything seems to work out OK.

        ROSS: I meant because the monkey in it reminds me of Marcel.

        PHOEBE: I can see that, 'cause they both have those big brown eyes and, ya know, the little pouty chin.
        MONICA: And the fact that they're both monkeys.

        ROSS: Sometimes I wonder if I did the right thing, ya know, giving him away.

        RACHEL: Oh, Ross, you had to, I mean, he was humping everything in sight. I mean, I have a Malibu Barbi that will no longer be wearing white to her wedding.

        ROSS: Remember when sometimes he'd borrow your hat, and, and when you got it back there'd be little monkey raisins in it.

        CHANDLER: Yeah, well sure, when he did it, it was funny. When I did it to my boss's hat. . . all of the sudden I have this big attitude problem.

        OPENING TITLES

        [Scene: Central Perk. Chandler, Monica, Rachel, and Phoebe are at the couch.]

        [Joey enters holding a letter]

        JOEY: Hey, hey, check it out, guess what I got.

        CHANDLER: Rhythm?

        JOEY: No, my first fan mail.

        ALL: Alright!

        MONICA: [reading] 'Dear Dr. Remore, know that I love you and would do anything to have you.' Gosh. 'Your not-so-secretive admirer, Erica Ford.' Ooh wait, 'PS enclosed please find 14 of my eyelashes.'

        RACHEL: Ya know, in crazy world, that means you're married.

        MONICA: This wasn't addressed to Days of Our Lives, this is, this came to your apartment. There's no stamp on it, this woman was in our building.

        JOEY: Oh my god, I got my very own stalker.

        [Ross enters with a suitcase]

        ROSS: Hey guys.

        ALL: Hey.

        PHOEBE: Ooh, where are you off to, Travelin' Jake?

        ROSS: Well, there's this, uh, paleontology conference in L.A. so I figured I'd go and then drive down to the zoo and surprise Marcel.

        CHANDLER: You know I think he will be surprised, 'till he realizes he's a monkey, and uh, you know, isn't capable of that emotion.

        [Rob (Chris Isaac) enters]

        RACHEL: Oh, Phoebe, that really cute guy is here again.

        PHOEBE: Oh, oh, OK, so everyone, pretend like I'm telling you a story, OK. And, and it's really funny. So everyone just laugh, now.

        [Everyone laughs]

        PHOEBE: I know, I know. [to Rob] Hello.

        ROB: Hi. I'm Rob Dohnen.

        PHOEBE: Hi Rob Dohnen.

        ROB: I don't know anything about music, but I think you're really, really great.

        PHOEBE: Oh, wow.

        ROB: Anyway, I schedule performers for the childrens libraries around the city and I was just thinking, have you ever thought about playing your songs for kids?

        PHOEBE: Oh, I would love to have kids. . . you're, you're the, you're, me play the songs that I will write for them.

        [Scene: Chandler and Joey's apartment. Chandler and Joey are standing around in the kitchen.]

        JOEY: Hey, whaddya wanna do for dinner?

        CHANDLER: Well we could just stay in and cook for ourselves. [both laugh hysterically]

        [door buzzer goes off]

        CHANDLER: Hello.

        ERICA: It's Erica.

        JOEY: Ah, the stalker.

        ERICA: Never mind, it's open.

        CHANDLER: [Joey grabs a frying pan] Yes, hitting her with a frying pan's a good idea. We might wanna have a backup plan, though, just in case she isn't a cartoon.

        JOEY: Let's get out of here.

        [They run out and knock on Monica and Rachel's door]

        CHANDLER: The one time they're not home.

        JOEY: OK, we'll just leave, and when we pass her on the stairs, she won't know it's me 'cause we've never met.
        CHANDLER: That's how radio stars escape stalkers.

        JOEY: She's comin'.

        [Both run back in their apartment. There's a knock at the door.]

        ERICA: It's me.

        JOEY: Uhh, this is it, this is how we're gonna die. Ready?

        CHANDLER: Wait, wait, wait. [Opens the top of the dish soap he's holding]

        [Joey opens the door and sees Erica (Brooke Shields). Joey gets a huge smile and Chandler squeezed the dish soap in the air.]

        ERICA: Hi.

        JOEY: Erica.

        [Scene: San Diego Zoo. Ross is at the Monkey cages.]

        LIPSON: Hi, Dean Lipson, zoo administrator. I was told you had a question.

        ROSS: Well, I uh, I can't seem to find the monkey I donated last year. He's a capuchan, answers to the name Marcel.

        LIPSON: Ahh, I'm afraid I have some bad news. Marcel has passed on.

        ROSS: Oh my God, what happened?

        LIPSON: Well he got sick, and then he got sicker, and then he got a little better but then he died.

        ROSS: I can't believe this.

        LIPSON: I'm sorry Mr. Geller. But ya know, there's an old saying, 'Sometimes monkeys die.' It's not a great saying but it certainly is fitting today.

        ROSS: Well, ya know, someone should have called me.

        LIPSON: I'm sorry. Look, I know this can't bring him back but here, it's just a gesture.

        ROSS: Zoo dollars?

        LIPSON: Yes, and come see the bird show at 4. The macaws wear hats. Well it's a lot cuter if your monkey hasn't just died.

        [Scene: Library. Phoebe is getting ready to sing for the kids. Chandler, Monica, and Rachel are there.]

        [Phoebe pulls out her guitar]

        KIDS: Ooohhh.

        PHOEBE: I know.

        MONICA: I can't believe Joey's having lunch with his stalker. What i-, what is she like.

        CHANDLER: Well, you remember Cathy Bates in Misery?

        RACHEL AND MONICA: Yeah.

        CHANDLER: Well, she looks the exact opposite of that.

        RACHEL: And she's not crazy?

        CHANDLER: Oh no no no, she's a total wack job. Yeah, she thinks that Joey is actually Dr. Drake Remore.

        RACHEL: Oh my God.

        MONICA: Ah, and I mean, he's going out with her? He can not persue this.

        CHANDLER: Hey, just because this woman thinks she can actually see Joey through the magical box in her living room doesn't mean she's not a person. I mean, does she not deserve happiness, does she not deserve love? What're you lookin' at me for? He's the one who wants to boff the maniac.

        ROB: You OK?

        PHOEBE: No, uh-uh, I'm just, I'm nervous. So, you know what, maybe if I just, if I picture them all in their underwear.

        ROB: That's not a good idea, that's kinda the reason the last guy got fired.

        PHOEBE: I'm just, I'm, I'm, I'm used to playing for grown-ups. Ya know, they just, grown-ups drink their coffee and do their grown-up thing, ya know, and kids listen. This is a huge responsibility. What? Are you gonna kiss me?

        ROSS: I was thinkin' about it.

        PHOEBE: OK. [they kiss] OK, alrighty, let's play some tunes. Hi everybody, I'm Phoebe

        ALL: Hi Phoebe.

        PHOEBE: OK, um, I'm gonna play, um, some songs about grandparents, OK. [singing]
        Now, grandma's a person who everyone likes,
        she bought you a train and a bright, shiny bike.
        But lately she hasn't been coming to dinner,
        And last time you saw her she looked so much thinner.
        Now, your mom and your dad said she moved to Peru,
        but the truth is she died and some day you will too.
        La-la-la la la-la-la la la-la-la la…

        [Scene: A nice restraunt. Joey and Erica are dining.]

        ERICA: Oh, Drake, isn't it amazing?

        JOEY: Yeah it is. . . what?

        ERICA: Well, here we sit, devil may care, just a little while ago you were reattaching someone's spinal cord.

        JOEY: Yeah, that was a tricky one. In reality, that operation takes like, over 10 hours, but they only showed it for 2 minites.

        ERICA: Who's they?

        JOEY: No one.

        ERICA: Oh Drake, you are so talented, let me see those hands. Oh these hands, these beautiful hands, oh I could just eat them. . . but I won't.

        JOEY: Good, otherwise my watch would fall off. [laughs hysterically]

        ERICA: No, seriously. These hands. These miracle, magical, life-giving hands. Oh, just to be near them, touch them, maybe even lick one?

        JOEY: Alright, just one. [she licks his hands rather emphatically] Wow, you're good at that.

        [Some guy at another table starts choking]

        WAITER: Oh my God! Someone, he's choking. Is anyone here a doctor?

        ERICA: Well, yes, yes, the best doctor in all of Salem, Dr. Drake Remore.

        [Scene: San Diege Zoo. Ross is still at the monkey cages. A janitor is sweeping.]

        JANITOR: Meet me in the nocturnal house in 15 minutes.

        ROSS: Uhh, hey look, I don't really enjoy being with other men that way. But, um, zoo dollars?

        JANITOR: It's about your monkey. It's alive.

        [Scene: Restraunt. Joey and Erica are still there.]

        ERICA: I don't understand, why didn't you help that man?

        JOEY: Uhh, cause, uhh, I'm a neurosurgeon and that was clearly a case of, uh, uh, foodal chokage. Alright, look, I got to tell you something.

        ERICA: No, no no no, you don't have to tell me anything. You don't have to explain yourself to me. Ooh, who am I to question the great Dr. Drake Remore?

        JOEY: But that's what…

        ERICA: I should just be happy to be near you.

        JOEY: Hey I- [she cuts him off with a kiss]

        ERICA: Hey what?

        JOEY: That's it, just hey. Like at the end of a dance, HEY! [she starts nibbling his hand] Hey. He-hey.

        [Scene: Library. Phoebe is singing.]

        PHOEBE: [singing] There'll be times when you get older
        when you'll want to sleep with people
        just to make them like you. . .
        But don't.
        Cause that's another thing that you don't wanna do, everybody
        That's another thing that you don't wanna do.

        MONICA: Excellent!

        CHANDLER: Very informative!

        RACHEL: Not at all inappropriate!

        PHOEBE: Thank you for coming everybody. There're cookies in the back.

        ROB: That was great, the kids loved you.

        PHOEBE: Yay, I rock.

        ROB: And you know why? Because you told the truth, and nobody ever tells kids the truth.You were incredible.

        PHOEBE: But.

        ROB: How did you know there was a but?

        PHOEBE: I sense these things. It was either but or butter.

        ROB: The thing is, I think some of the parents, they were kinda hopin' that you'd play more songs about like, barnyard animals.

        PHOEBE: I can do that.

        ROB: Really?

        PHOEBE: Yeah.

        ROB: Because that would be fantastic. What? You wanna kiss me?

        PHOEBE: Thinkin' about it.

        [Scene: San Diego Zoo. Ross and the janitor are in the nocturnal house.]

        JANITOR: Ahh, the bat. Ambassador of darkness, flitting out of his cave like a winged messenger, sightless spectre of the macabe.

        ROSS: Buddy, my monkey?

        JANITOR: Oh, yeah, right. There was a break-in, few months back, inside job. Your monkey was taken.

        ROSS: Oh my God. But the zoo told me that my monkey was dead.

        JANITOR: The zoo! Do you believe everything the zoo tells ya?

        ROSS: That, that's the only thing the zoo's ever told me.

        JANITOR: Of course they're gonna say he's dead. They don't want the bad publicity. It's all a great big cover-up. Do you have any idea how high up this thing goes?

        ROSS: That guy Lipson?

        JANITOR: Lipson knows. Do you have any idea who else knows?

        ROSS: No, I, I only know Lipson.

        JANITOR: Hmm, Lipson knows huh? Ahh, hello Mr. Opossum, enigma of the trees, upside-down denizen of the night, taunting gravity with…

        ROSS: Buddy, my monkey, my monkey.

        JANITOR: Word on the street - well, when I say street, I mean those little pretend streets they have here at the zoo.

        ROSS: Of course.

        JANITOR: Your monkey found a new career, in the entertainment field. That's all I know.

        ROSS: This is unbelievable.

        JANITOR: So, what is this information worth to you, my friend?

        ROSS: Are you trying to get me to bribe you?

        JANITOR: Maybe.

        ROSS: But you already told me everything.

        [Scene: Library. Ross show up with a MonkeyShine Beer poster.]

        ROSS: Check it out, he actually is the MonkeyShine monkey.

        RACHEL: Well, so what're you gonna do?

        ROSS: Well, I guess I'm gonna call the beer company and try to find out where he is.

        CHANDLER: That's what I did when I lost my Clydesdales.

        PHOEBE: OK, hi again.

        ALL: Hi Phoebe.

        PHOEBE: Today we're gonna start with some songs about barnyard animals.
        [singing] Oh, the cow in the meadow goes moo,
        Oh, the cow in the meadow goes moo.
        Then the farmer hits him on the head and grinds him up,
        And that's how we get hamburgers.
        Nooowww, chickens!

        [Scene: Chandler and Joey's apartment. Monica, Rachel, and the guys are watching Days of Our Lives.]

        TV DOCTOR: You're the only one who can save her Drake.

        JOEY ON TV: Damnit, I'm a doctor, I'm not God.

        ROSS: Well, there goes my whole belief system.

        [knock at the door]

        ERICA: It's Erica.

        JOEY: Oh my God, quick turn off the TV.

        RACHEL: No no no, wait, I wanna see what happens.

        JOEY: Uh, I get Leslie out of the coma and then we make out.

        RACHEL: Well how can that be, you were just kissing Sabrina?

        MONICA: Rachel, it's a world where Joey is a neuro-surgeon.

        JOEY: Hey Erica, c'mon in.

        ERICA: How did you get here so fast, I just saw you in Salem?

        JOEY: Right, they uh, they choppered me in. What's up?

        ERICA: Ohh, and I see you're having a little party too. Is she here, huh, huh?

        JOEY: Who?

        ERICA: Sabrina. I know about you two. I saw you today kissing in the doctor's lounge.

        JOEY: It's not what you think, that was…

        ERICA: You told me I was the only one. [throws a glass of water in his face]

        JOEY: Alright look, that's it. I don't think we should see each other anymore, alright. Look, I know I should have told you this a long time ago but I am not Drake Remore, OK. I'm not even a doctor, I'm an actor. I just pretend to be a doctor.

        ERICA: Oh my God. Do the people at the hospital know about this?

        JOEY: Somebody wanna help me out here?

        RACHEL: Oh, I know, I know. [Turns on the TV. Joey in on it.]

        ERICA: How, how can you be here and there.

        JOEY:'Cause it's a television show.

        ERICA: Drake, what're you getting at?

        JOEY: I'm not Drake.

        ROSS: That's right, he's not Drake, he's Hans Remore, Drake's evil twin.

        ERICA: Is this true?

        RACHEL: Yes, yes it is true. And I know this because, because he pretended to be Drake to, to sleep with me. [throws water in his face]

        MONICA: And then he told me he would run away with me, and he didn't. [throws water in his face]

        CHANDLER: And you left the toilet seat up, you bastard. [throws water in his face]

        ERICA: Is all this true?

        JOEY: Yes, I'm afraid it is. You deserve much better than me Erica. You deserve to be with the real Drake, he's the one you fell in love with. Go to Salem, find him, he's the guy for you.

        ERICA: Oh Hans. [They kiss]

        ROSS: Hans…Hans…Yo evil twin.

        JOEY: Right. Goodbye Erica, good luck in Salem. Take care

        ERICA: I'll never forget you Hans. [Joey shuts the door in her face]

        JOEY: OK, alright, the people who threw the water.

        [Scene: Central Perk. Phoebe and Rob are sitting on the couch.]

        PHOEBE: Fired! Why?

        ROB: The library board has had a lot of complaints from parents about some of the stuff in your songs.

        PHOEBE: I can't believe it. Did you tell your board about how kids want to hear the truth?

        ROB: No.

        PHOEBE: I see.

        ROB: Maybe if you just played some regular kiddie songs.

        PHOEBE: No. What do you, what do you want me to be, like some stupid, big, like, purple dinosaur?

        ROB: I'm not saying you have to be Barney.

        PHOEBE: Who's Barney.

        [Scene: Central Perk. The whole gang is there.]

        ROSS: Well, I tracked down Marcel and get this, he's healthy, he's happy, and he's right here in New York filming Outbreak II - The Virus Takes Manhattan.

        RACHEL: You're kidding.

        JOEY: This is amazing.

        ROSS: I know.

        JOEY: I finally get a part on TV and the monkey's makin' movies.

        PHOEBE: OK, Rachel, I'm ready.

        RACHEL: OK.

        [little kid enters]

        KID: Excuse me. Is this where the singing lady is that tells the truth?

        PHOEBE: Um, yeah I guess that's me.

        KID: [shouting out the door] She's here.

        [a rush of kids enter]

        PHOEBE: [singing] Sometimes men love women,
        sometimes men love men,
        and then there are bisexuals,
        though some just say they're kidding themselves.
        la la-la-la la-la-la-la-la-la-la…

        [Scene: City street. The whole gang is walking up to the movie set.]

        ROSS: This is so exciting, I haven't seen my monkey in almost a year.

        CHANDLER: What, you never look down in the shower? Oh please. I'm not allowed to make one joke in the monkey-is-penis genre?

        SECURITY GUARD: C'mon people, back up please, back up, c'mon, c'mon, c'mon, c'mon.

        ROSS: Uh, excuse me, uh, where can we find the monkey?

        SECURITY GUARD: I'm sorry guys, closed set.

        ROSS: Uh, I'm sorry, you don't understand, I'm, I'm, I'm a friend of his. We uh, we used to live together.

        SECURITY GUARD: Yeah, and I have a time share in the Pocanos with Flipper.

        MONICA: Ross, there he is.

        ROSS: Hey, hey buddy, Marcel. Marcel. [Marcel doesn't react so Ross starts singing] In the jungle, the mighty jungle the lion sleeps tonight. [no reaction from Marcel, Monica and Joey urge him on] In the jungle, the mighty jungle the lion sleeps tonight. [Marcel looks over and everyone joins in] a-weema-way, a-weema-way… [Marcel runs over and hops up on Ross's shoulder]

        [Scene: The next time at the movie set.]

        SECURITY GUARD: Uh, excuse me folks this is a uhh…

        JOEY: Closed set. We know but we're friends with the monkey. [guard lets them in]

        ROSS: Good morning. Hey pal, look who I brought. It's your old friend Harry Elefante. [Marcel grabs the elephant doll and throws it to the ground]

        JOEY: Woah, dude, burn.

        ROSS: I don't get it, he seemed so happy to see me yesterday.

        TRAINER: Hey don't take it personal, he's under a lot of pressure, ya know, starring in a movie and all.

        RACHEL: Now just how big of a star is Marcel?

        TRAINER: In human terms, I'd say Cybill Shepard.

        ALL: Woah.

        CHANDLER: [to guys wering yellow isolation suits] So, are you guys in the movie, or are you just really paranoid.

        DIRECTOR'S ASSISTANT: Hey Sal, Jerry wants to know if the monkey's ready for the subway set?

        JOEY: Uh, excuse me. Jerry is the director, which one's he?

        DIRECTOR'S ASSISTANT: The one in the director's chair.

        JOEY: Gotcha. Phoebs, walk with me.

        PHOEBE: OK. Um, how come I'm walking with you?

        JOEY: Well, we're, we're just goin' over here so that we can get away from the horrible flesh eating virus, for the love of God woman, listen to me. Is he lookin', is he lookin'?

        SUSIE: We've got a problem.

        DIRECTOR'S ASSISTANT: Tell me.

        SUSIE: I can't do Chris's makeup. She refuses to acknowledge that she has a moustasche.

        DIRECTOR'S ASSISTANT: Is it bad?

        SUSIE: It looks like one of her eyebrows fell down. Now unless someone convinces her to let me bleach it, Jean-Claude Van Damme is gonna be making out with Gabe Kaplan.

        DIRECTOR'S ASSISTANT: I'll talk to her.

        SUSIE: I hate actors.

        CHANDLER: [to an extra in fatigues] Nice camoflauge man, for a minute there I almost didn't see ya.

        SUSIE: Excuse me.

        CHANDLER: Ahhhh.

        SUSIE: Uh, is your name Chandler?

        CHANDLER: Uh, yes, yes it is.

        SUSIE: Chandler Bing?

        CHANDLER: Do you know me or are you just really good at this game?

        SUSIE: I'm Susie Moss. Fourth grade, glasses, I used to carry around a box of animal crackers like a purse.
        CHANDLER: Susie Moss, right, yeah, wow, you look. . . great job growing up.

        SUSIE: It's nice to see you're not still wearing that denim cap with all the little mirrors on it.

        CHANDLER: Oh, right, well yeah, I graduated fourth grade and realized I wasn't a pimp.

        SUSIE: Remember the class play? You, you pulled up my skirt and the entire auditorium saw my underpants.

        CHANDLER: Yes, back then I, uh, used humor as a defense mechanism. Thank God I don't do that anymore.

        [cut to Monica and Rachel walking through the set]

        MONICA: Oh my God, oh my God, oh my God.

        RACHEL: What what what what?

        MONICA: Jean-Claude Van Damme. I didn't know he was in this movie, he is so hot.

        RACHEL: Ya think?

        MONICA: The muscles from Brussels, wham bam Van Damme, did you see Time Cop?

        RACHEL: No, was he any good in it?

        MONICA: Rachel, he like, totally changed time.

        RACHEL: Wow, so why don't you go talk to him?

        MONICA: Oh, yeah.

        RACHEL: What, so you go over there, you tell him you think he's cute, what's the worst that could happen?

        MONICA: He could hear me.

        RACHEL: OK, I'm doin' it for ya.

        MONICA: Oh Rachel don't, don't you dare, don't, don't. Tell him I cook.

        RACHEL: Excuse me. Hi.

        VAN DAMME: Hi.

        RACHEL: Um, this is gonna sound kinda goofy but uhhm, my friend over there, who cooks by the way, um, she thinks you're cute.

        VAN DAMME: You don't think I'm cute?

        RACHEL: I, I don't know, um, do you think you're cute? OK, we're kinda gettin' off the track here. Um, I was supposed to come here and tell you my friend thinks you're cute. So what should I tell her?

        VAN DAMME: You can tell her I think her friend is cute.

        [back to Chandler and Susie]

        CHANDLER: No, Stephen Hurs was the kid who would eat anything for money, David Stein was the guy who had no elbows.

        SUSIE: OK, well then who was the kid that got caught masturbating?

        CHANDLER: OK that's not what he was doing. Alright, he was looking for his bus money.

        [a voice in the background calls for makeup]

        SUSIE: Oh that's me, I gotta go.

        CHANDLER: Oh uh, o, OK.

        SUSIE: Um, so listen, how many times am I gonna have to touch you on the arm before you ask me on a date.

        CHANDLER: Well, uh, let's try one more. . . there you go, say Ernie's, 8 o'clock.

        SUSIE: I'll be there, and who knows, if things go well, maybe this time I'll get to see your underwear.

        CHANDLER: No one was around to hear that?

        [back to Rachel and Monica]

        MONICA: So what'd he say?

        RACHEL: Agh, what a jerk. I kept talking about you and he kept asking me out. I mean, naturally, you know, I said no.

        MONICA: Well, thanks anyway.

        RACHEL: He just kept asking, and asking, and asking, and asking, and asking, and asking.

        MONICA: Rachel if you, if you want to go out with him, you can. Sound like a big jerk to me but if that's what you want to do…

        RACHEL: Jean-Claude she said yes, I'll see you tonight. Thank you.

        [Scene: Central Perk. Joey and the girls are sitting at the couches.]

        RACHEL: And then Jean-Claude took me to that place Crossroads and that's where we hung out with Drew Barrymore.

        JOEY: Oh man, she's so smokin, she has got the greatest set of. . . no guys around, huh.

        RACHEL: Does anybody need anything?

        MONICA: Oh, I'll have an espresso. Oh acutally, I'll get it. If I ask you to, you'll probably end up drinking it yourself.

        RACHEL: That is so unfair.

        PHOEBE: I know. Oh, like you would drink her coffee after what you did to her with Van Damme.

        [Ross enters]

        ROSS: Hey Joey I have to cancel racketball for tonight, that was Marcel's trainer. He's gonna let me have him for a couple of hours.

        JOEY: You're blowin' me off for a monkey?

        ROSS: Hey, we can rescedule for Saturday.

        JOEY: Yeah, unless you hook up with a bunch of pigeons.

        [Chandler enters]

        CHANDLER: Hey, stick a fork in me, I am done.

        PHOEBE: Stick a fork what?

        CHANDLER: Like, when you're cooking a steak.

        PHOEBE: Oh, OK, I don't eat meat.

        CHANDLER: Well then, how do you know when vegetables are done?

        PHOEBE: Well you know, you juist, you eat them and you can tell.

        CHANDLER: OK, then, eat me, I'm done.

        CHANDLER: I've met the perfect woman. OK, we're sitting on her couch, we're fooling around, and then suddenly she turns to me and says, 'Do you ever want to do it in an elevator?'

        MONICA: What did you say?

        CHANDLER: Ahh, I believe my exact words were, 'Flaign,en - sten'. I mean I didn't know what to say, how do you know if you wanna do it on an elevator?

        PHOEBE: Oh, you just know.

        [Scene: Chandler and Joey's apartment. Chandler and Susie are making out on the couch.]

        SUSIE: Oh, shoot, we gotta go, got a reservation in 30 minutes.

        CHANDLER: Oh no no no no, no no no no no no, you see, what I had planned shouldn't take more that 2, 3 minutes tops.

        SUSIE: Oh, 200 seconds of passion. We gotta go.

        SUSIE: But um, here's an idea, have you ever worn women's underwear?

        CHANDLER: Well, ye, yes, actually, but, uh, they were my Aunt Edna's, and there were three of us in there.

        SUSIE: Well I was thinking it would be um, kind of sexy if you wore mine tonight, at dinner.

        CHANDLER: You want me to wear your panties?

        SUSIE: Could ya?

        CHANDLER: Well, if I was wearing your underwear then, uh, what would you be wearing?. . . You're swell.

        [Scene: Ross's apartment. Ross is setting up for his time with Marcel. Joey is there.]

        ROSS: OK, got the music, got the dinner. Oh and check it out, I made Marcel's favorite dish, banannacake.

        JOEY: Oooh.

        ROSS: With mealworms.

        JOEY: Yaaahhh. Ahhh, candles. What'dya thinks gonna happen here tonight?

        [phone rings]

        ROSS: Hello. Oh hi, are you on your way ove-. Oh. No, no, I, I understand, I mean a monkey's gotta work. No it, it's no big deal, it' not like I uh, had anything special planned. Yeah OK, OK. OK, OK, bye.

        [Scene: Monica and Rachel's apartment. Monica and Rachel are upset with each other. Phoebe is mediating.]

        PHOEBE: OK, Rachel, why don't you start talking first.

        RACHEL: Alright, I feel that this is totally unjustified. [Monica starts making faces behind her back] She gave me the green light, I did nothing but-. Do you think I can't see you in the TV set?

        PHOEBE: Alright Monica, if there is something that you would like to share…

        MONICA: Ya know, you had no right to go out with him.

        RACHEL: That is the most ridiculous.

        MONICA: You sold me out.

        RACHEL: I did not sell you out.

        MONICA: Yes you did. Absolutely.

        RACHEL: Would you let me talk. [flicks Monica on the forehead]

        MONICA: Did you just flick me?

        RACHEL: OK, well, you wouldn't let me finish and I was jus- [Monica flicks her back] Ow. That hurt [flicks Monica]

        MONICA: Quit flicking [flicks]

        RACHEL: Ow, you stop flicking.

        MONICA: You flicked me first.

        [They keep flicking each other. This turns into slapping each other. This leads to wrestling on the floor. All the while Phoebe is saying "Happy thoughts". Eventually Phoebe gets fed up.]

        PHOEBE: OK, now I'm gonna kick some ass.

        [Phoebe grabs each of them by an ear]

        MONICA AND RACHEL: Ow. Ow. Ow.

        PHOEBE: Alright, now I will let go if you both stop.

        RACHEL: Oh, what do you, you want me to stop seeing him, is that what you want?

        MONICA: Uh-huh.

        RACHEL: You want me to just call him up and tell him that you're seeing him instead? That's what you want?

        MONICA: OK.

        RACHEL: Oh that's what you want.

        MONICA: Yes.

        RACHEL: Fine.

        MONICA: Fine,

        PHOEBE: There we go.You know what, if we were in prison, you guys would be, like, my bitches.

        [Scene: A fancy restraunt (Marcel's). Joey, Ross, Chandler, Susie, and the Director's Assistant are there.]

        ROSS: Thanks for letting me tag along tonight you guys.

        JOEY: Forget about it.

        SUSIE: How you doin there squirmy?

        CHANDLER: I'm hangin in. . . and a little out.

        JOEY: So, assistant to the director. That's a really exciting job, I mean, you must have a ton of cool responsibilities.

        DIRECTOR'S ASSISTANT: I have nothing to do with casting.

        JOEY: So what're you guys gonna eat?

        SUSIE: How come all I can think about is putting that ice in my mouth and licking you all over?

        CHANDLER: Because I went to an all boys high school and God is making up for it.

        SUSIE: I want you right here, right now.

        CHANDLER: Right now, right here. Don't ya think we're in kind of a public plaaaa [Susie grabs him under the table] They do have the shrimp.

        SUSIE: Meet me in the bathroom. [she leaves for the bathroom]

        CHANDLER: I'm going to the bathroom now. [leaves for the bathroom]

        [In the bathroom Susie and Chandler are kissing. She backs into a stall.]

        SUSIE: C'mon.

        CHANDLER: I can't believe we're doing this.

        SUSIE: Alright mister, let's see those panties.

        CHANDLER: Alrighty. [we see Chandler's pants drop from under the stall door]

        SUSIE: Ooh. Ooh. But ya know what would be even sexier?

        CHANDLER: What?

        SUSIE: If you didn't have your shirt tucked into them.

        CHANDLER: Oh.

        SUSIE: Alright. Now I would like to see you wearing nothing but them. Take your clothes off.

        CHANDLER: OK, but uh, I hope you realize this means we're gonna miss hearing about the specials.

        SUSIE: C'mon hurry, hurry.

        CHANDLER: Hey, do you want this done quick, or do you want this done right?

        SUSIE: Alright, turn around. Time to see you from behind.

        CHANDLER: OK.

        [She turns him facing the toilet and sneaks out of the stall and gathers up his clothes.]

        SUSIE: Oh, somebody's been doing his buns of steel video.

        CHANDLER: Well, you want me to uh, clench anything, or-… Susie? Susie.

        SUSIE: This is for the fourth grade.

        CHANDLER: Huh? Where, whaddya mean?

        SUSIE: Whaddo I mean. Whaddya mean, whaddo I mean? I mean underpants, mister, that's what I mean.

        CHANDLER: What, what's what you mean?

        SUSIE: My skirt, you lifted, kids laughing. I was Susie Underpants 'till I was 18.

        CHANDLER: That was in the fourth grade. How could you still be upset about that?

        SUSIE: Well um, why don't you call me in 20 years and tell me if you're still upset about this. [she leaves with his clothes]

        CHANDLER: Alright, I hope you realize you're not getting these underpants back.

        [Scene: Monica and Van Damme are walking down the street.]

        MONICA: I can't believe this, just like 2 weeks ago I was watching Sudden Death, now I'm on a date with Jean-Claude Van Damme. Can you beat up that guy? [he nods] Can you beat up that guy?

        VAN DAMME: Sure.

        MONICA: This is so wild. Ya know, I gotta admit, I was kinda surprised that you agreed to go on a blind date.

        VAN DAMME: Normally, I would not do it.

        MONICA: Well, what made you make the exception for me?

        VAN DAMME: 'Cause Rachel told me uh, you were dying to have a threesome with me and uh, Drew Barrymore. By the way, Drew has some groundrules and…

        [Scene: Back at Monica and Rachel's apartment. They are now fighting about what Rachel told Van Damme.]

        MONICA: Say you're sorry.

        RACHEL: No. [hitting each other]

        MONICA: Say it.

        RACHEL: No. [hitting again]

        [Monica grabs Rachel by the sweater. Rachel squirms out of it]

        MONICA: Rachel, you say you're sorry or your sweater gets it.

        RACHEL: OK, OK, that is my favorite sweater, that is my third date sweater.

        MONICA: Say you're sorry.

        RACHEL: OK, you wanna play? OK, let's play, let's play. [She grabs a jar of tomato sauce and Monica's purse]

        MONICA: What're you gonna do?

        RACHEL: You give me back my sweater or it's handbag marinara.

        MONICA: You don't have the guts.

        RACHEL: Oh yeah. Well, at least I wasn't too chicken to tell some guy I thought he was cute.

        [Monica pulls a thread on Rachel's sweater and Rachel dumps the tomato sauce in Monica's purse]

        PHOEBE: Oh alright, stop, STOP THE MADNESS. This is crazy. Who can even remember why this even started in the first place?

        [Monica and Rachel start yelling at the same time]

        PHOEBE: Yes that's right. But still, I-, look at your purse, look at your sweater, look at yourselves.

        MONICA: I'll help you fix your sweater.

        RACHEL: I'll help you throw out your purse.

        MONICA: I'm sorry that I made you stop seeing him.

        RACHEL: Well, I'm sorry I went out with him when I knew you liked him.

        MONICA: I'm sorry that I borrowed your gloves [pulls Rachel's gloves out of her purse]

        [Scene: Back at the restroom at Marcel's. Chandler is still in the stall, Joey comes in to go to the bathroom.]

        [Joey starts whistling, Chandler finishes the tune. Joey whistles again.]

        CHANDLER: Joey?

        JOEY: Ma?

        CHANDLER: Joey!

        JOEY: Chandler? What're you still doin' here, I though you guys took off.

        CHANDLER: Oh, no no no, she took off with my clothes.

        JOEY: Are you naked in there?

        CHANDLER: Not exactly. . . I'm wearin panties.

        JOEY: Huh, you uh, you always wear panties?

        CHANDLER: No, no, this is the first time.

        JOEY: Wow, talk about your bad luck, I mean, the first time you try panties and someone walks off with your clothes.

        CHANDLER: I was not trying them out, Susie asked me to wear them.

        JOEY: Well, let me see.

        CHANDLER: No. I'm not letting you or anybody else see, ever.

        JOEY: Alright, alright. [climbs up in the next stall and looks over at Chandler] Woah, someone's flossing.

        [Ross enters, sees Joey in the mirror]

        ROSS: [to Joey who's looking over a toilet stall] Joey, some people don't like that.

        JOEY: Chandler's wearing panties.

        ROSS: What? Let me see. [climbs up in the other adjoining stall]

        CHANDLER: No, no, you don't have to see.

        ROSS: Hi Tushie.

        CHANDLER: Alright, one of you give me your underpants.

        JOEY: Can't help you, I'm not wearing any.

        CHANDLER: How can you not be wearing any underwear?

        JOEY: Oh, I'm gettin' heat from the guy in the hot pink thong.

        CHANDLER: Alright look Ross I'll give you 50 dollars for your underpants.

        [Some guy has entered.]

        ALL: Hi.

        [Back at the table. Joey and Ross return. Shortly, Chandler comes out, holding the stall door in front of him, and leaves.]

        [Scene: Central Perk. Ross, Phoebe, and Chandler are sitting.]

        CHANDLER: Hey Phoebs, can I have the milk after you?

        PHOEBE: I'm almost done with it, keep your panties on.

        [Joey enters]

        JOEY: Hey, hey, and I'm in the movie.

        ROSS: What happened?

        JOEY: One of the virus victims called in sick, so Cathy recommended me and boom, I'm dying on the gurney. Oh Ross, Marcel just finished his last scene if you want to go down there and say goodbye.

        ROSS: Ahh, oh that's OK, I mean, he's probably got, you know, parties to go to and stuff. But, ya know, he's moved on. Hey, that, that's the way it goes right.

        PHOEBE: [sees Marcel at the window] Oh my God.

        ROSS: What?

        ["Looks Like We Made It" starts playing and we enter a whole sequence of Marcel and Ross having fun in the city.]

        [Scene: The movie set. Monica and Rachel are saying goodbye to Jean-Claude]

        VAN DAMME: [to Rachel] I'm sorry it didn't work out between you and me, [to Monica] or you and me. Drew was very disappointed.

        RACHEL: OK, well, bye. [kisses him]

        VAN DAMME: Goodbye.

        MONICA: Well, bye for me too. [kisses him]

        RACHEL: OK, well, bye-bye again. [kisses him again]

        MONICA: OK.

        VAN DAMME: Perhaps, uh, the three of us, just could. . .

        MONICA AND RACHEL: Oh, no no no no no.

        VAN DAMME: Are you sure, I can crush a walnut with my butt.

        MONICA AND RACHEL: No no no no.

        RACHEL: Impressive.

        MONICA: But no. Maybe if I were baking.

        MONICA AND RACHEL: Bye-bye.

        [Scene: City street. Whole gang is there seeing off Marcel.]

        ROSS: Bye Marcel. See ya on the big screen. You keep people drinkin' that beer, OK. I miss you buddy.

        [Marcel is driven off in a limo]

        PHOEBE: You know, I think I want to write a song about all this.

        RACHEL: Oh yeah.

        PHOEBE: Yeah. Oh, except one of the strings on my guitar is broken. Hey, Chandler, can I borrow your G-string?

        CHANDLER: How long you been waitin' to say that?

        PHOEBE: About 20 minutes. CLOSING CREDITS

        [Scene: Filming a scene from the movie. Joey is dying on a gurney, Van Damme is looking over him.]

        VAN DAMME: Can't you see what's going on here, this man is dying.

        JOEY: Aaaaagggghhhhh.

        DIRECTOR: Cut.

        VAN DAMME: Can't you see what's going on here, this man is dying.

        JOEY: Aaaaagggghhhhh.

        DIRECTOR: Cut.

        VAN DAMME: Can't you see what's going on here, this man is dying.

        JOEY: Aaaaagggghhhhh. Mommy

        DIRECTOR: Cut.

        VAN DAMME: Can't you see what's going on here, this man is dead

        展开全文
      • 1.To print the date of the day before yesterday:date --date='2 days ago'2. To print the date of the day three months and one day hence:date --date='3 months 1 day'3. To print the day of year of Christ...

        1.To print the date of the day before yesterday:

        date --date='2 days ago'

        2. To print the date of the day three months and one day hence:

        date --date='3 months 1 day'

        3. To print the day of year of Christmas in the current year:

        date --date='25 Dec' +%j

        4. To print the current full month name and the day of the month:

        date '+%B %d'

        But this may not be what you want because for the first nine days

        of the month, the `%d' expands to a zero-padded two-digit field,

        for example `date -d 1may '+%B %d'' will print `May 01'.

        5. To print a date without the leading zero for one-digit days of the

        month, you can use the (GNU extension) `-' flag to suppress the

        padding altogether:

        date -d 1may '+%B %-d

        6. To print the current date and time in the format required by many

        non-GNU versions of `date' when setting the system clock:

        date +%m%d%H%M%Y.%S

        7. To set the system clock forward by two minutes:

        date --set='+2 minutes'

        8. To print the date in RFC 2822 format, use `date --rfc-2822'.  Here

        is some example output:

        Fri, 09 Sep 2005 13:51:39 -0700

        9. To convert a date string to the number of seconds since the epoch

        (which is 1970-01-01 00:00:00 UTC), use the `--date' option with

        the `%s' format.  That can be useful in sorting and/or graphing

        and/or comparing data by date.  The following command outputs the

        number of the seconds since the epoch for the time two minutes

        after the epoch:

        date --date='1970-01-01 00:02:00 +0000' +%s

        date --date='1970-01-01 00:02:00 +0000' +%s

        120

        If you do not specify time zone information in the date string,

        `date' uses your computer's idea of the time zone when

        interpreting the string.  For example, if your computer's time

        zone is that of Cambridge, Massachusetts, which was then 5 hours

        (i.e., 18,000 seconds) behind UTC:

        # local time zone used

        date --date='1970-01-01 00:02:00' +%s

        18120

        10. If you're sorting or graphing dated data, your raw date values may

        be represented as seconds since the epoch.  But few people can

        look at the date `946684800' and casually note "Oh, that's the

        first second of the year 2000 in Greenwich, England."

        date --date='2000-01-01 UTC' +%s

        946684800

        An alternative is to use the `--utc' (`-u') option.  Then you may

        omit `UTC' from the date string.  Although this produces the same

        result for `%s' and many other format sequences, with a time zone

        offset different from zero, it would give a different result for

        zone-dependent formats like `%z'.

        date -u --date=2000-01-01 +%s

        946684800

        To convert such an unwieldy number of seconds back to a more

        readable form, use a command like this:

        11. local time zone used

        date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"

        1999-12-31 19:00:00 -0500

        Often it is better to output UTC-relative date and time:

        date -u -d '1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z"

        2000-01-01 00:00:00 +0000

        来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29446986/viewspace-1428178/,如需转载,请注明出处,否则将追究法律责任。

        展开全文
      • iOS 各版本中的新特性(What's New in iOS) 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循“署名-非商业用途-保持一致”创作公用协议 转载请保留此句:太阳火神的美丽人生 - 本博客...

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

        太阳火神的美丽人生 (http://blog.csdn.net/opengl_es)

        本文遵循“署名-非商业用途-保持一致”创作公用协议

        转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino否则,出自本博客的文章拒绝转载或再转载,谢谢合作。


        介绍 Introduction
        文档组织结构 Organization of This Document 

        iOS 7.0

        用户界面更改 User Interface Changes 

        UI重新设计 UI Redesign

        视图动态行为 Dynamic Behaviors for Views 

        文本工具箱 Text Kit 

        64位支持 64-Bit Support

        多任务加强 Multitasking Enhancements 

        游戏 Games 

        精灵工具箱框架 Sprite Kit Framework

        游戏控制器框架 Game Controller Framework 

        游戏中心改进 Game Center Improvements 

        地图 Maps

        空中投放 AirDrop

        应用内音频 Inter-App Audio

        点对点联接 Peer-to-Peer Connectivity

        新框架 New Frameworks

        已有框架的加强 Enhancements to Existing Frameworks 

        UIKit框架 UIKit Framework 

        商店工具箱框架 Store Kit Framework 

        通行证工具箱框架 Pass Kit Framework 

        开放图形库嵌入式系统版本 OpenGL ES 

        消息用户界面框架 Message UI Framework 

        Media Player FrameworkMap Kit Framework 

        图象读写框架 Image I/O Framework 

        iAd广告框架 iAd Framework 

        游戏工具箱框架 Game Kit Framework

        基础框架 Foundation Framework

        核心电话框架 Core Telephony Framework

        核心动作框架 Core Motion Framework

        核心位置框架 Core Location Framework

        核心基础框架 Core Foundation Framework

        核心蓝牙框架 Core Bluetooth Framework

        音视频基础框架 AV Foundation Framework

        加速框架 Accelerate Framework

        Objective-C语言 Objective-C

        弃用的API Deprecated APIs 

        iOS 6.1

        地图开发包搜索组件 Map Kit Searches 

        iOS 6.0

        地图 Maps

        社交框架 Social Framework

        通行证开发包 Pass Kit

        游戏中心 Game Center

        提醒 Reminders

        应用内支付 In-App Purchase

        集合视图 Collection Views

        UI元素状态保持 UI State Preservation

        自动布局 Auto Layout

        数据私有 Data Privacy

        额外的框架加强 Additional Framework Enhancements 

        UIKit 框架 UIKit Framework

        开放嵌入式系统图形库 OpenGL ES

        媒体播放框架 Media Player Framework

        图像IO框架 Image IO Framework

        iAd广告框架 iAd Framework

        基础框架 Foundation Framework

        外设框架 External Accessory Framework

        事件开发包框架 Event Kit Framework

        核心视频框架 Core Video Framework

        核心媒体柜架 Core Media Framework

        核心位置框架 Core Location Framework 

        核心蓝牙框架 Core Bluetooth Framework

        核心音频 Core Audio

        音视频基础框架 AV Foundation Framework

        广告支持框架 Ad Support Framework

        促进框架 Accelerate Framework 

        iOS 5.1 

        文本输入视图中支持口述 Dictation Support in Text Input Views 

        iOS 5.0

        iCloud云存储开发接口 iCloud Storage APIs

        iCloud云备份 iCloud Backup

        ARC自动引用计数 Automatic Reference Counting

        故事板 Storyboards 

        创建故事板文件 Creating Storyboard Files 

        准备迁移到一个新的视图控制器 Preparing to Transition to a New View Controller

        编码呈现故事板视图控制器 Presenting Storyboard View Controllers Programmatically

        报摊支持 Newsstand Support

        AirPlay无线播放改进 AirPlay Improvements

        新框架 New Frameworks

        OpenGLES图形库开发包框架 GLKit Framework

        核心图形框架 Core Image Framework

        推特社交网框架 Twitter Framework

        帐户框架 Accounts Framework

        通用安全服务框架 Generic Security Services Framework

        核心蓝牙 Core Bluetooth

        应用设计层面的改进 App Design-Level Improvements

        文档支持 Document Support

        数据保护的改进 Data Protection Improvements

        UIKit控件的自定义呈现 Custom Appearance for UIKit Controls

        容器视图控制器支持 Container View Controller Support

        设置 Settings

        XCode工具 Xcode Tools

        XCode改进 Xcode Improvements

        OpenGL ES调试 OpenGL ES Debugging

        UI自动化的加强 UI Automation Enhancements

        分析工具集 Instruments

        额外的框架加强 Additional Framework Enhancements

        用户界面开发包框架 UIKit 

        开放嵌入式系统图形库框架 OpenGL ES

        开放音频库框架 OpenAL 

        消息用户界面框架 Message UI

        媒体播放框架 Media Player

        地图开发包框架 Map Kit

        iAd广告框架 iAd

        游戏开发包框架 Game Kit 

        基础框架 Foundation

        外设框架 Accessory

        事件开发包和事件开发包用户界面 Event Kit and Event Kit UI

        核心动作框架 Core Motion

        核心位置框架 Core Location

        核心图形框架 Core Graphics

        核心数据框架 Core Data

        核心音频框架 Core Audio

        音视频基础框架 AV Foundation

        资料库框架 Assets Library

        地址簿框架 Address Book

        安全框架 Security 

        iOS 4.3
        AirPlay无线视频支持 AirPlay Video Support
        框架加强 Framework Enhancements
        音视频基础框架 AV Foundation
        核心音频框架 Core Audio Frameworks
        iAd广告框架 iAd
        媒体播放框架 Media Player

        用户界面开发包框架 UIKit 

        iOS 4.2

        打印 Printing

        无线播放 AirPlay

        核心音乐设备数字接口 Core MIDI

        弱链接支持(弱引用的前身) Weak Linking Support

        框架加强 Framework Enhancements

        核心位置 Core Location 

        游戏开发包 Game Kit 

        广告 iAd

        媒体播放 Media Player

        用户界面开发包 UIKit 

        iOS 4.1

        游戏中心 Game Center

        框架加强 Framework Enhancements 

        音视频基础 AV Foundation 

        资源库 Assets Library

        核心文本 Core Text 

        系统配置 System Configuration

        用户界面开发包 UIKit 

        iOS 4.0

        多任务 Multitasking

        集成技术 Integration Technologies 

        位置通知 Local Notifications

        事件开发包 Event Kit

        核心动作 Core Motion

        数据保护 Data Protection

        核心电话 Core Telephony

        广告 iAd 

        图形和多媒体 Graphics and Multimedia

        高分辩率屏幕支持 High-Resolution Screen Support

        快速查看框架 Quick Look Framework 

        音视频基础框架 AV Foundation 

        资源库 Assets Library 

        图像IO框架 Image I/O

        核心媒体 Core Media

        核心视频 Core Video

        核心服务 Core Services

        块对象 Block Objects

        GCD异步中心分发执行框架 Grand Central Dispatch

        加速促进框架 Accelerate Framework

        Xcode 工具 Xcode Tools

        Xcode 改进 Xcode Improvements

        UI自动化开发接口 UI Automation API

        框架加强 Framework Enhancements

        UIKit框架加强 UIKit Framework Enhancements

        Foundation框架加强 Foundation Framework Enhancements

        OpenGL ES框架加强 OpenGL ES Enhancements

        游戏开发包加强 Game Kit Enhancements

        核心位置框架加强Core Location Enhancements

        地图开发包框架加强 Map Kit Enhancements

        消息用户界面加强 Message UI Enhancements

        核心图形框架加强 Core Graphics Enhancements

        ICU加强 ICU Enhancements

        继承的改进 Inherited Improvements

        文档修订历史 Document Revision History 


        介绍 Introduction

        本文档描述不同版本iOS中引入的开发级特性。针对每一个版本发布,本文档都提供链接到增量引用文档,列出该发布版本中引入的新的和更新的编程接口。

        This document describes developer-level features that were introduced in different versions of iOS. For each shipping release, this document provides links to “delta” reference documents, which list the new and changed programming interfaces that were introduced in that release.

        文档组织结构 Organization of This Document

        本文档包含如下的文章 

        This document includes the following articles:

        “iOS 7.0”(page 8) 描述iOS 7.0中的新增和更新的特性。
        “iOS 7.0”(page 8) describes the new and updated features in iOS 7.0.

        “iOS 6.1”(page 25) describes the new and updated features in iOS 6.1.

        “iOS 6.0”(page 26) describes the new and updated features in iOS 6.0.

        “iOS 5.1”(page 38) describes the new and updated features in iOS 5.1.

        “iOS 5.0”(page 39) describes the new and updated features in iOS 5.0.

        “iOS 4.3”(page 62) describes the new and updated features in iOS 4.3.

        “iOS 4.2”(page 65) describes the new and updated features in iOS 4.2.

        “iOS 4.1”(page 69) describes the new and updated features in iOS 4.1.

        “iOS 4.0”(page 71) describes the new and updated features in iOS 4.0.


        iOS 7.0

        iOS 7 is a major update with compelling features for developers to incorporate into their apps. The user interfacehas been completely redesigned. In addition, iOS 7 introduces a new animation system for creating 2D and2.5D games. Multitasking enhancements, peer-to-peer connectivity, and many other important features makeiOS 7 the most significant release since the first iPhone SDK.

        This article summarizes the key developer-related features introduced in iOS 7. This version of the operatingsystem runs on current iOS devices. In addition to describing the key new features, this article lists the documentsthat describe those features in more detail.

        For late-breaking news and information about known issues, seeiOS 7 Release Notes. For the complete list ofnew APIs added in iOS 7, seeiOS 7.0 API Diffs.

        User Interface Changes

        iOS 7 includes many new features intended to help you create great user interfaces.

        UI Redesign

        The iOS 7 user interface has been completely redesigned. Throughout the system, a sharpened focus onfunctionality and on the user’s content informs every aspect of design. Translucency, refined visual touches,and fluid, realistic motion impart clarity, depth, and vitality to the user experience. Whether you are creatinga new app or updating an existing one, keep these qualities in mind as you work on the design.

        Apps compiled against the iOS 7 SDK automatically receive the new appearance for any standard system viewswhen the app is run on iOS 7. If you use Auto Layout to set the size and position of your views, those viewsare repositioned as needed. But there may still be additional work to do to make sure your interface has theappearance you want. Similarly, if you customize your app’s views, you may need to make changes to supportthe new appearance fully.

        For guidance on how to design apps that take full advantage of the new look in iOS 7, seeiOS 7 Design Re-sources.


        Dynamic Behaviors for Views

        Apps can now specify dynamic behaviors forUIViewobjects and for other objects that conform to theUIDynamicItemprotocol. (Objects that conform to this protocol are calleddynamic items.) Dynamic behaviorsoffer a way to improve the user experience of your app by incorporating real-world behavior and characteristics,such as gravity, into your app’s animations. UIKit supports the following types of dynamic behaviors:

        A UIAttachmentBehaviorobject specifies a connection between two dynamic items or between anitem and a point. When one item (or point) moves, the attached item also moves. The connection is notcompletely static, though. An attachment behavior has damping and oscillation properties that determinehow the behavior changes over time.

        A UICollisionBehaviorobject lets dynamic items participate in collisions with each other and withthe behavior’s specified boundaries. The behavior also lets those items respond appropriately to collisions.

        A UIGravityBehaviorobject specifies a gravity vector for its dynamic items. Dynamic items acceleratein the vector’s direction until they collide with other appropriately configured items or with a boundary.

        A UIPushBehaviorobject specifies a continuous or instantaneous force vector for its dynamic items.
        A
        UISnapBehaviorobject specifies a snap point for a dynamic item. The item snaps to the point with a

        configured effect. For example, it can snap to the point as if it were attached to a spring.

        Dynamic behaviors become active when you add them to an animator object, which is an instance of theUIDynamicAnimatorclass. The animator provides the context in which dynamic behaviors execute. A givendynamic item can have multiple behaviors, but all of those behaviors must be animated by the same animatorobject.

        For information about the behaviors you can apply, seeUIKit Framework Reference.

        Text Kit

        Text Kit is a full-featured set of UIKit classes for managing text and fine typography. Text Kit can lay out styledtext into paragraphs, columns, and pages; it easily flows text around arbitrary regions such as graphics; and itmanages multiple fonts. Text Kit is integrated with all UIKit text-based controls to enable apps to create, edit,display, and store text more easily—and with less code than was previously possible in iOS.

        Text Kit comprises new classes and extensions to existing classes, including the following:

        The NSAttributedStringclass has been extended to support new attributes.
        The
        NSLayoutManagerclass generates glyphs and lays out text.
        The
        NSTextContainerclass defines a region where text is laid out.
        The
        NSTextStorageclass defines the fundamental interface for managing text-based content.

        For more information about Text Kit, seeText Programming Guide for iOS.

        64-Bit Support

        Apps can now be compiled for the 64-bit runtime. All system libraries and frameworks are 64-bit ready, meaningthat they can be used in both 32-bit and 64-bit apps. When compiled for the 64-bit runtime, apps may runfaster because of the availability of extra processor resources in 64-bit mode.

        iOS uses the same LP64 model that is used by OS X and other 64-bit UNIX systems, which means fewer problemswhen porting code. For information about the iOS 64-bit runtime and how to write 64-bit apps, see64-BitTransition Guide for Cocoa Touch.

        Multitasking Enhancements

        iOS 7 supports two new background execution modes for apps:

        Apps that regularly update their content by contacting a server can register with the system and belaunched periodically to retrieve that content in the background. To register, include theUIBackgroundModeskey with the fetchvalue in your app’sInfo.plistfile. Then, when your app islaunched, call thesetMinimumBackgroundFetchInterval:method to determine how often it receivesupdate messages. Finally, you must also implement theapplication:performFetchWithCompletionHandler:method in your app delegate.

        Apps that use push notifications to notify the user that new content is available can fetch the content inthe background. To support this mode, include theUIBackgroundModeskey with theremote-notificationvalue in your app’sInfo.plistfile. You must also implement theapplication:didReceiveRemoteNotification:fetchCompletionHandler:method in your appdelegate.

        Apps supporting either thefetchorremote-notificationbackground modes may be launched or movedfrom the suspended to background state at appropriate times. In the case of thefetchbackground mode,the system uses available information to determine the best time to launch or wake apps. For example, it doesso when networking conditions are good or when the device is already awake. You can also send silent pushnotifications—that is, notifications that do not display alerts or otherwise disturb the user.

        For small content updates, use theNSURLRequestclass. To upload or download larger pieces of content inthe background, use the newNSURLSessionclass. This class improves on the existingNSURLConnectionclass by providing a simple, task-based interface for initiating and processingNSURLRequestobjects. A singleNSURLSessionobject can initiate multiple download and upload tasks, and use its delegate to handle anyauthentication requests coming from the server.

        For more information about the new background modes, see “App States and Multitasking” iniOS AppProgramming Guide.

        Games

        iOS 7 includes enhanced support for games.

        Sprite Kit Framework

        The Sprite Kit framework (SpriteKit.framework) provides a hardware-accelerated animation systemoptimized for creating 2D and 2.5D games. Sprite Kit provides the infrastructure that most games need, includinga graphics rendering and animation system, sound playback support, and a physics simulation engine. UsingSprite Kit frees you from creating these things yourself, and it lets you focus on the design of your content andthe high-level interactions for that content.

        Content in a Sprite Kit app is organized into scenes. A scene can include textured objects, video, path-basedshapes, Core Image filters, and other special effects. Sprite Kit takes those objects and determines the mostefficient way to render them onscreen. When it is time to animate the content in your scenes, you can useSprite Kit to specify explicit actions you want performed, or you can use the physics simulation engine to definephysical behaviors (such as gravity, attraction, or repulsion) for your objects.

        In addition to the Sprite Kit framework, there are Xcode tools for creating particle emitter effects and textureatlases. You can use the Xcode tools to manage app assets and update Sprite Kit scenes quickly.

        For more information about how to use Sprite Kit, seeSprite Kit Programming Guide. To see an example ofhow to use Sprite Kit to build a working app, seecode:Explained Adventure.

        Game Controller Framework

        The Game Controller framework (GameController.framework) lets you discover and configureMade-for-iPhone/iPod/iPad (MFi) game controller hardware in your app. Game controllers can be devicesconnected physically to an iOS device or connected wirelessly over Bluetooth. The Game Controller frameworknotifies your app when controllers become available and lets you specify which controller inputs are relevantto your app.

        For more information about supporting game controllers, seeGame Controller Programming Guide.

        Game Center Improvements

        Game Center includes the following improvements:

        Turn-based matches now support a new feature known asexchanges. Exchanges let players initiate actionswith other players, even when it is not their turn. You can use this feature to implement simultaneousturns, player chats, and trading between players.

        The limit on per-app leaderboards has been raised from 25 to 100. You can also organize your leaderboardsusing aGKLeaderboardSetobject, which increases the limit to 500.

        You can add conditions to challenges that define when the challenge has been met. For example, achallenge to beat a time in a driving game might stipulate that other players must use the same vehicle.

        The framework has improved its authentication support and added other features to prevent cheating.For more information about how to use the new Game Center features, seeGame Center Programming Guide.

        For information about the classes of the Game Kit framework, seeGame Kit Framework Reference.

        Maps

        The Map Kit framework (MapKit.framework) includes numerous improvements and features for apps thatuse map-based information. Apps that use maps to display location-based information can now take fulladvantage of the 3D map support found in the Maps app, including controlling the viewing perspectiveprogrammatically. Map Kit also enhances maps in your app in the following ways:

        Overlays can be placed at different levels in the map content so that they appear above or below otherrelevant data.

        You can apply an MKMapCameraobject to a map to add position, tilt, and heading information to itsappearance. The information you specify using the camera object imparts a 3D perspective on the map.

        The MKDirectionsclass lets you ask for direction-related route information from Apple. You can usethat route information to create overlays for display on your own maps.

        The MKGeodesicPolylineclass lets you create a line-based overlay that follows the curvature of theearth.

        Apps can use the MKMapSnapshotterclass to capture map-based images.
        The visual representation of overlays is now based on the
        MKOverlayRendererclass, which replaces

        overlay views and offers a simpler rendering approach.

        Apps can now supplement or replace a map’s existing tiles using theMKTileOverlayandMKTileOverlayRendererclasses.

        For more information about the classes of the Map Kit framework, seeMap Kit Framework Reference.

        AirDrop

        AirDrop lets users share photos, documents, URLs, and other kinds of data with nearby devices. AirDrop supportis now built in to the existingUIActivityViewControllerclass. This class displays different options forsharing the content that you specify. If you are not yet using this class, you should consider adding it to yourinterface.

        To receive files sent via AirDrop, do the following:

        In Xcode, declare support for the document types your app supports. (Xcode adds the appropriate keysto your app’sInfo.plistfile.) The system uses this information to determine whether your app canopen a given file.

        Implement the application:openURL:sourceApplication:annotation:method in your appdelegate. (The system calls this method when a new file is received.)

        Files sent to your app are placed in theDocuments/Inboxdirectory of your app’s home directory. If you planto modify the file, you must move it out of this directory before doing so. (The system allows your app to readand delete files in this directory only.) Files stored in this directory are encrypted using data protection, so youmust be prepared for the file to be inaccessible if the device is currently locked.

        For more information about using an activity view controller to share data, seeUIActivityViewController ClassReference.

        Inter-App Audio

        The Audio Unit framework (AudioUnit.framework) adds support for Inter-App Audio, which enables theability to send MIDI commands and stream audio between apps on the same device. For example, you mightuse this feature to record music from an app acting as an instrument or use it to send audio to another appfor processing. To vend your app’s audio data, publish a I/O audio unit (AURemoteIO) that is visible to otherprocesses. To use audio features from another app, use the audio component discovery interfaces in iOS 7.

        For information about the new interfaces, see the framework header files. For general information about theinterfaces of this framework, seeAudio Unit Framework Reference.

        Peer-to-Peer Connectivity

        The Multipeer Connectivity framework (MultipeerConnectivity.framework) supports the discovery ofnearby devices and the direct communication with those devices without requiring Internet connectivity. Thisframework makes it possible to create multipeer sessions easily and to support reliable in-order data transmissionand real-time data transmission. With this framework, your app can communicate with nearby devices andseamlessly exchange data.

        The framework provides programmatic and UI-based options for discovering and managing network services.Apps can integrate theMCBrowserViewControllerclass into their user interface to display a list of peerdevices for the user to choose from. Alternatively, you can use theMCNearbyServiceBrowserclass to lookfor and manage peer devices programmatically.

        For more information about the interfaces of this framework, seeMultipeer Connectivity Framework Reference.

        New Frameworks

        iOS 7 includes the following new frameworks:

        The Game Controller framework (GameController.framework) provides an interface for communicatingwithgame-relatedhardware;see“GameControllerFramework”(page11).

        The Sprite Kit framework (SpriteKit.framework) provides support for sprite-based animations andgraphics rendering; see “Sprite Kit Framework”(page 11).

        The Multipeer Connectivity framework (MultipeerConnectivity.framework) provides peer-to-peernetworking for apps; see “Peer-to-Peer Connectivity”(page 14).

        The JavaScript Core framework (JavaScriptCore.framework) provides Objective-C wrapper classesfor many standard JavaScript objects. Use this framework to evaluate JavaScript code and parse JSONdata. For information about the classes of this framework, see the framework header files.

        The Media Accessibility framework (MediaAccessibility.framework) manages the presentation ofclosed-captioned content in your media files. This framework works in conjunction with new settings thatlet the user enable the display of closed captions.

        The Safari Services framework (SafariServices.framework) provides support for programmaticallyadding URLs to the user’s Safari reading list. For information about the class provided by this framework,see the framework header files.

        Enhancements to Existing Frameworks

        In addition to its new features, iOS 7 also includes significant enhancements, organized here by framework.For a complete list of new interfaces, seeiOS 7.0 API Diffs .

        UIKit Framework

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

        All UI elements have been updated to present the new look associated with iOS 7.
        UIKit Dynamics lets you mimic real-world effects such as gravity in your animations; see
        “Dynamic Behaviors

        for Views”(page 9).

        Text Kit provides sophisticated text editing and display capabilities; see“Text Kit”(page 9).

        The UIViewclass defines the following additions:

        The tintColorproperty applies a tint color to both the view and its subviews. For information on howto apply tint colors, seeiOS 7 UI Transition Guide.

        You can create keyframe-based animations using views. You can also make changes to your views andspecifically prevent any animations from being performed.

        The UIViewControllerclass defines the following additions:
        View controller transitions can be customized, driven interactively, or replaced altogether with ones you

        designate.

        View controllers can now specify their preferred status bar style and visibility. The system uses the providedinformation to manage the status bar style as new view controllers appear. You can also control how thisbehavior is applied using the UIViewControllerBasedStatusBarAppearancekey in your app’sInfo.plistfile.

        The UIMotionEffectclass defines the basic behavior for motion effects, which are objects that definehow a view responds to device-based motion.

        Collection views add support for intermediate layout transitions and invalidation contexts (invalidationcontexts help you improve the performance of your custom layout code). You can also apply UIKit Dynamicsto collection view layout attributes to animate the items in the collection.

        The imageNamed:method ofUIImagesupports retrieving images stored in asset catalogs, which are away to manage and optimize assets that have multiple sizes and resolutions. You create asset catalogs inXcode.

        There are methods on UIViewandUIScreenfor creating a snapshot of their contents. Generatingsnapshots using these new interfaces is significantly faster than rendering the view or screen contentsyourself.

        Gesture recognizers can specify dependencies dynamically to ensure that one gesture recognizer failsbefore another is considered.

        The UIKeyCommandclass wraps keyboard events received from an external hardware keyboard. Theseevents are delivered to the app’s responder chain for processing.

        A UIFontDescriptorobject describes a font using a dictionary of attributes. Use font descriptors tointeroperate with other platforms.

        The UIFontandUIFontDescriptorclasses support dynamic text sizing, which improves legibility fortext in apps. With this feature, the user controls the desired font size that all apps in the system shoulduse.

        The UIActivityclass now supports new activity types, including activities for sending items via AirDrop,adding items to a Safari reading list, and posting content to Flickr, Tencent Weibo, and Vimeo.

        The UIApplicationDelegateprotocol adds methods for handling background fetch behaviors.
        The
        UIScreenEdgePanGestureRecognizerclass is a new gesture recognizer that tracks pan gestures

        that originate near an edge of the screen.

        UIKit adds support for running in a guided-access mode, which allows an app to lock itself to preventmodification by the user. This mode is intended for institutions such as schools, where users bring theirown devices but need to run apps provided by the institution.

        State restoration now allows the saving and restoration of any object. Objects adopting theUIStateRestoringprotocol can write out state information when the app moves to the backgroundand have that state restored during subsequent launches.

        Table views now support estimating the height of rows and other elements, which improves scrollingperformance.

        You can now more easily configure aUISearchDisplayControllerobject to work with aUINavigationBarobject.

        For information about the classes of this framework, seeUIKit Framework Reference.

        Store Kit Framework

        The Store Kit framework (StoreKit.framework) has migrated to a new receipt system that developers canuse to verify in-app purchases on the device itself. You can also use it to verify the app purchase receipt onthe server.

        For more information about how to use this new receipt system, seeReceipt Validation Programming Guide.

        Pass Kit Framework

        The Pass Kit framework (PassKit.framework) includes new APIs for adding multiple passes in a singleoperation.

        These new features were added to the pass file format:

        New keys specify the expiration date for a pass.
        You can specify that a pass is relevant only when it is in the vicinity of specific iBeacons.

        New attributes control how a pass is displayed. You can group passes together, display links with customtext on the back of a pass, and control how time values are displayed on the pass.

        You can now associate extra data with a pass. This data is available to your app but is not displayed to theuser.

        You can designate which data detectors to apply to the fields of your passes.
        For information about how to use Pass Kit in your app, see
        Passbook Programming Guide. For information

        about the pass file format, seePassbook Package Format Reference.

        OpenGL ES

        iOS 7 adds support for OpenGL ES 3.0 and adds new features to OpenGL ES 2.0.

        OpenGL ES 3.0 includes as core functionality the features of many extensions supported in OpenGL ES 2.0on iOS. But OpenGL ES 3.0 also adds new features to the OpenGL ES shading language and new corefunctionality that has never been available on mobile processors before, including multiple render targetsand transform feedback. You can use OpenGL ES 3 to more easily implement advanced renderingtechniques, such as deferred rendering.

        To create an OpenGL ES 3 context on devices that support it, pass thekEAGLRenderingAPIOpenGLES3constant to theinitWithAPI:method.

        OpenGL ES 2 adds the following new extensions:
        The
        EXT_sRGBextension adds support for sRGB framebuffer operations.

        The GL_EXT_pvrtc_sRGBextension adds support for sRGB texture data compressed in the PVRTCtexture compression format. (This extension is also supported in OpenGL ES 3.0).

        The GL_EXT_draw_instancedandGL_EXT_instanced_arraysextensions can improve renderingperformance when your app draws multiple instances of the same object. You use a single call todraw instances of the same object. You add variation to each instance by specifying how fast eachvertex attribute advances or by referencing an ID for each instance in your shader.

        Textures can be accessed in vertex shaders in both OpenGL ES 2.0 and 3.0. Query the value of theMAX_VERTEX_TEXTURE_IMAGE_UNITSattribute to determine the exact number of textures you canaccess. In earlier versions of iOS, this attribute always had a value of0.

        For more information, see OpenGL ES Programming Guide for iOSandiOS Device Compatibility Reference.

        Message UI Framework

        In the Message UI framework, theMFMessageComposeViewControllerclass adds support for attachingfiles to messages.

        For information about the new interfaces, see the framework header files. For information about the classesof this framework, seeMessage UI Framework Reference.

        Media Player Framework

        In the Media Player framework, theMPVolumeViewclass provides support for determining whether wirelessroutes such as AirPlay and Bluetooth are available for the user to select. You can also determine whether oneof these wireless routes is currently active. For information about the new interfaces, see the framework headerfiles.

        For information about the classes of Media Player framework, seeMedia Player Framework Reference.

        Map Kit Framework

        The Map Kit framework (MapKit.framework) includes changes that are described in “Maps”(page 12).For information about the classes of this framework, seeMap Kit Framework Reference.

        Image I/O Framework

        The Image I/O framework (ImageIO.framework) now has interfaces for getting and setting image metadata.For information about the new interfaces, see the framework header files. For information about the classes

        of this framework, see Image I/O Reference Collection.

        iAd Framework

        The iAd framework (iAd.framework) includes two extensions to other frameworks that make it easier toincorporate ads into your app’s content:

        The framework introduces new methods on theMPMoviePlayerControllerclass that let you run adsbefore a movie.

        The framework extends the UIViewControllerclass to make it easier to create ad-supported content.You can now configure your view controllers to display ads before displaying the actual content theymanage.

        For information about the new interfaces, see the framework header files. For information about the classesof this framework, seeAd Support Framework Reference.

        Game Kit Framework

        The Game Kit framework (GameKit.framework) includes numerous changes, which are described in “GameCenter Improvements”(page 12).

        For information about the classes of this framework, seeGame Kit Framework Reference.

        Foundation Framework

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

        The NSDataclass adds support for Base64 encoding.

        The NSURLSessionclass is a new class for managing the acquisition of network-based resources. (Youcan use it to download content even when your app is suspended or not running.) This class serves as areplacement for theNSURLConnectionclass and its delegate; it also replaces theNSURLDownloadclassand its delegate.

        The NSURLComponentsclass is a new class for parsing the components of a URL. This class supports theURI standard (rfc3986/STD66) for parsing URLs.

        The NSNetServiceandNSNetServiceBrowserclasses support peer-to-peer discovery over Bluetoothand Wi-Fi.

        The NSURLCredentialandNSURLCredentialStorageclasses let you create credentials with asynchronizable policy, and they provide the option of removing credentials with a synchronizable policyfrom iCloud.

        The NSURLCache,NSURLCredentialStorage, andNSHTTPCookieStorageclasses now support theasynchronous processing of storage requests.

        The NSCalendarclass supports new calendar types.
        The
        NSProgressclass provides a general-purpose way to monitor the progress of an operation and report

        that progress to other parts of your app that want to use it.

        For information about the new interfaces, see the framework header files and Foundation release notes. Forgeneral information about the classes of this framework, seeFoundation Framework Reference.

        Core Telephony Framework

        The Core Telephony framework (CoreTelephony.framework) lets you get information about the type ofradio technology in use by the device. Apps developed in conjunction with a carrier can also authenticateagainst a particular subscriber for that carrier.

        For information about the new interfaces, see the framework header files. For general information about theclasses of the Core Telephony framework, seeCore Telephony Framework Reference.

        Core Motion Framework

        The Core Motion framework (CoreMotion.framework) adds support for step counting and motion tracking.With step counting, the framework detects movements that correspond to user motion and uses that informationto report the number of steps to your app. Because the system detects the motion, it can continue to gatherstep data even when your app is not running. Alongside this feature, the framework can also distinguishdifferent types of motion, including different motions reflective of travel by walking, by running, or byautomobile. Navigation apps might use that data to change the type of directions they give to users.

        For information about the classes of this framework, seeCore Motion Framework Reference.

        Core Location Framework

        The Core Location framework (CoreLocation.framework) supports region monitoring and ranging usingBluetooth devices. Region monitoring lets you determine whether the iOS device enters a specific area, andranging lets you determine the relative range of nearby Bluetooth devices. For example, an art museum mightuse region monitoring to determine whether a person is inside a particular gallery, and then place iBeaconsnear each painting. When the person is standing by a painting, the app would display information about it.

        The framework also supports deferring the delivery of location updates until a specific time has elapsed or theuser has moved a minimum distance.

        For general information about the classes of this framework, seeCore Location Framework Reference.

        Core Foundation Framework

        The Core Foundation framework (CoreFoundation.framework) now lets you schedule stream objects ondispatch queues.

        For information about the new interfaces, see the framework header files. For general information about theinterfaces of this framework, seeCore Foundation Framework Reference.

        Core Bluetooth Framework

        The Core Bluetooth framework (CoreBluetooth.framework) includes the following enhancements:

        The framework supports saving state information for central and peripheral objects and restoring thatstate at app launch time. You can use this feature to support long-term actions involving Bluetooth devices.

        The central and peripheral classes now use anNSUUIDobject to store unique identifiers.You can now retrieve peripheral objects from a central manager synchronously.

        For information about the classes of this framework, seeCore Bluetooth Framework ReferenceandCore BluetoothProgramming Guide.

        AV Foundation Framework

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

        The AVAudioSessionclass supports the following new behaviors:
        Selecting the preferred audio input, including audio from built-in microphones

        Multichannel input and output

        The AVVideoCompositingprotocol and related classes let you support custom video compositors.

        The AVSpeechSynthesizerclass and related classes provide speech synthesis capabilities.

        The capture classes add support and interfaces for the following features:

        Discovery of a camera’s supported formats and frame rates
        High fps recording
        Still image stabilization
        Video zoom (true and digital) in recordings and video preview, including custom rampingReal-time discovery of machine-readable metadata (barcodes)

        Autofocus range restriction
        Smooth autofocus for capture
        Sharing your app’s audio session during captureAccess to the clocks used during capture

        Access to capture device authorization status (user must now grant access to the microphone andcamera)

        Recommended settings for use with data outputs and asset writer

        There are new metadata key spaces for supported ISO formats such as MPEG-4 and 3GPP, and improvedsupport for filtering metadata items when copying those items from source assets to output files usingtheAVAssetExportSessionclass.

        The AVAssetWriterclass provides assistance in formulating output settings, and there are new levelconstants for H.264 encoding.

        The AVPlayerLayerclass adds thevideoRectproperty, which you can use to get the size and positionof the video image.

        The AVPlayerItemclass supports the following changes:
        Asset properties can be loaded automatically when
        AVPlayerItemobjects are prepared for playback.

        When you link your app against iOS 7 SDK, the behavior when getting the values of player itemproperties—such as theduration,tracks, orpresentationSizeproperties—is different fromthe behaviors in previous versions of iOS. The properties of this class now return a default value andno longer block your app if theAVPlayerItemobject is not yet ready to play. As soon as the playeritem’s status changes toAVPlayerItemStatusReadyToPlay, the getters reflect the actual valuesof the underlying media resource. If you use key-value observing to monitor changes to the properties,your observers are notified as soon as changes are available.

        The AVPlayerItemLegibleOutputclass can process timed text from media files.
        The
        AVAssetResourceLoaderDelegateprotocol now supports loading of arbitrary ranges of bytes

        from a media resource.
        For information about the new interfaces, see the framework header files. For general information about the

        classes of this framework, seeAV Foundation Framework Reference.

        Accelerate Framework

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

        Improved support for manipulating Core Graphics data types
        Support for working with grayscale images of 1, 2, or 4 bits per pixel
        New routines for converting images between different formats and transforming image contentsSupport for biquad (IIR) operations

        For information about the new interfaces, see the framework header files. For general information about thefunctions and types of this framework, seeAccelerate Framework Reference.

        Objective-C

        The Objective-C programming language has been enhanced to support modules, which yield faster builds andshorter project indexing times. Module support is enabled in all new projects created using Xcode 5. If youhave existing projects, you must enable this support explicitly by modifying your project’s Enable Modulessetting.

        Deprecated APIs

        From time to time, Apple adds deprecation macros to APIs to indicate that those APIs should no longer beused in active development. When a deprecation occurs, it is not an immediate end-of-life to the specified API.Instead, it is the beginning of a grace period for transitioning off that API and onto newer and more modernreplacements. Deprecated APIs typically remain present and usable in the system for a reasonable amount oftime past the release in which they were deprecated. However, active development on them ceases and theAPIs receive only minor changes—to accommodate security patches or to fix other critical bugs. DeprecatedAPIs may be removed entirely from a future version of the operating system.

        As a developer, it is important that you avoid using deprecated APIs in your code as soon as possible. At aminimum, new code you write should never use deprecated APIs. And if you have existing code that usesdeprecated APIs, update that code as soon as possible. Fortunately, the compiler generates warnings wheneverit spots the use of a deprecated API in your code, and you can use those warnings to track down and removeall references to those APIs.

        This release includes deprecations in the following technology areas:

        The Map Kit framework includes deprecations for theMKOverlayViewclass and its various subclasses.The existing overlay views have been replaced with an updated set of overlay renderer objects that descendfrom theMKOverlayRendererclass. For more information about the classes of this framework, seeMapKit Framework Reference.

        The Audio Session API in the Audio Toolbox framework is deprecated. Apps should use theAVAudioSessionclass in the AV Foundation framework instead.

        The CLRegionclass in the Core Location framework is replaced by theCLCircularRegionclass. TheCLRegionclass continues to exist as an abstract base class that supports both geographic and beaconregions.

        The UUIDproperty of theCBCentralclass is deprecated. To specify the unique ID of your central objects,use theidentifierproperty instead.

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

        The UIKit framework contains the following deprecations:

        The wantsFullScreenLayoutproperty ofUIViewControlleris deprecated. In iOS 7 and later,view controllers always support full screen layout.

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

        Many drawing additions to theNSStringclass are deprecated in favor of newer variants.Thegethostuuidfunction in thelibsyscalllibrary is deprecated.

        In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value02:00:00:00:00:00. If you need to identify the device, use the identifierForVendorproperty ofUIDeviceinstead. (Apps that need an identifier for their own advertising purposes should consider usingtheadvertisingIdentifierproperty of ASIdentifierManagerinstead.)

        For a complete list of specific API deprecations, seeiOS 7.0 API Diffs.


        iOS 6.1

        This article summarizes the key developer-related features introduced in iOS 6.1. This version of the operatingsystem runs on current iOS-based devices. In addition to describing the key new features, this article lists thedocuments that describe those features in more detail.

        For late-breaking news and information about known issues, seeiOS 6.1 Release Notes. For the complete listof new APIs added in iOS 6.1, seeiOS 6.1 API Diffs.

        Map Kit Searches

        The Map Kit framework now lets you programmatically search for map-based addresses and points of interest.TheMKLocalSearchclass initiates a search for map-based content using a natural language string. In otherwords, you can enter place name information or portions of an address and have Map Kit return search resultsthat match the information you provide. For example, searching for the string “coffee” would return the locationof local coffee bars along with information about each one.

        For more information about the classes of the Map Kit framework, including the new search-related classes,seeMap Kit Framework Reference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.25

        iOS 6.0

        This article summarizes the key developer-related features introduced in iOS 6. This version of the operatingsystem runs on current iOS-based devices. In addition to describing the key new features, this article lists thedocuments that describe those features in more detail.

        For late-breaking news and information about known issues, seeiOS 6.0 Release Notes. For the complete listof new APIs added in iOS 6, seeiOS 6.0 API Diffs.

        Maps

        In addition to the new map tiles provided by Apple, the Maps app and MapKit framework now support additionalinteractions with other apps. Apps that do not incorporate their own map support now have an easier way tolaunch the Maps app and display points of interest or directions. Apps that offer routing information, such asturn-by-turn navigation services, can now register as a routing app and make those services available to theentire system.

        Registering as a routing app gives you more opportunities to get your app in front of users. Routing apps arenot limited to just driving or walking directions. Routing apps can also include apps that provide directionsfor 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 theApp Store and can provide the user with the option to purchase those apps and use them for directions.

        Apps that do not provide routing directions themselves can also take advantage of both Maps and routingapps. Apps can use new interfaces to ask the Maps app to display specific locations or to display routingdirections between two locations.

        For information about how to provide directions from your app, or how to use the Maps app to display directions,seeLocation and Maps Programming Guide.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.26

        iOS 6.0

        Social Framework

        Social Framework

        The Social framework (Social.framework) provides a simple interface for accessing the user’s social mediaaccounts. This framework supplants the Twitter framework that was introduced in iOS 5 and adds support forother social accounts, including Facebook and Sina’s Weibo service. Apps can use this framework to post statusupdates and images to a user’s account. This framework works with the Accounts framework to provide asingle sign-on model for the user and to ensure that access to the user’s account is approved.

        The UIKit framework also provides a newUIActivityViewControllerclass for displaying actions that theuser might perform on some selected content. One use of this class is to allow the user to post content tosocial accounts, such as Twitter or Facebook. You present this class modally on iPhone or using a popovercontroller on iPad. When the user taps one of the buttons, the view controller presents a new interface toperform the associated action.

        For more information about the Social framework, seeSocial Framework Reference. For information about theUIActivityViewControllerclass, seeUIKit Framework Reference.

        Pass Kit

        Pass Kit is a new technology that uses web services, a new file format, and an Objective-C framework(PassKit.framework) to implement support for downloadable passes. Companies can create passes torepresent items such as coupons, boarding passes, event tickets, and discount cards for businesses. Instead ofcarrying a physical representation of these items, users can now store them on their iOS device and use themthe same way as before.

        Passes are created by your company’s web service and delivered to the user’s device via email, Safari, or yourcustom app. The pass itself uses a special file format and is cryptographically signed before being delivered.The file format identifies relevant information about the service being offered so that the user knows what itis for. It might also contain a bar code or other information that you can then use to validate the card so thatit can be redeemed or used.

        For more information about Pass Kit and for information how to add support for it into your apps, seePassbookProgramming Guide.

        Game Center

        Game Center has been updated and new features have been added to improve the game playing experience.The Game Kit framework (GameKit.framework) includes the following incremental and major changes:

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.27

        iOS 6.0

        Reminders

        Challenges allow a player to challenge a friend to beat an achievement or score. Players can issue challengesfrom the Game Center app. You can also use theGKChallengeclass to issue challenges from within yourgame.

        The GKGameCenterViewControllerclass incorporates all of the previous capabilities of the leaderboard,achievement and friend request view controllers. You can use the previous view controllers too, but theynow 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 theauthenticateHandlerproperty to a block that performs all the authentication steps. Once set, GameKit automatically authenticates the local player when necessary. However, Game Kit does not display theauthentication interface directly. Instead, it lets your handler present the provided authentication viewcontroller, 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 listof players in order. If a player times out, the next player in the list is asked to take a turn instead.

        The GKMatchmakerclass 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-insupport.

        The GKPlayerclass now supports display names for players.

        The GKMatchclass 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 theGKMatchinfrastructure.

        The GKAchievementclass now allows multiple achievements to be submitted at the same time.For more information about how to use Game Center in your app, seeGame Center Programming Guide.

        Reminders

        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 caninclude proximity or time-based alarms.

        For more information about the interfaces of the Event Kit framework, including the new interfaces for creatingreminders, seeEvent Kit Framework Reference.

        In-App Purchase

        The Store Kit framework (StoreKit.framework) now supports the purchasing of iTunes content inside yourapp and provides support for having downloadable content hosted on Apple servers. With in-app contentpurchases, you present a view controller that lets users purchase apps, music, books, and other iTunes contentdirectly from within your app. You identify the items you want to make available for purchase but the rest ofthe transaction is handled for you by Store Kit.

        Prior to iOS 6, you were responsible for managing any downloadable content made available through in apppurchase. Hosted downloads now simplify the work you need to do to make content available to users. Thenew SKDownloadclass represents a downloadable piece of content. In addition, theSKPaymentTransactionclass has been modified to provide an array of download objects for any hosted content. To download a pieceof content, you queue a download object on the payment queue. When the download completes, your paymentqueue observer is notified.

        For more information about the classes of the Store Kit framework, seeStore Kit Framework Reference.

        Collection Views

        The UICollectionViewclass 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 classworks closely with an accompanying layout object to define the placement of individual data items. UIKitprovides a standard flow-based layout object that you can use to implement multi-column grids containingitems of standard or varying sizes. And if you want to go beyond grid layouts, you can create your own customlayout objects to support any layout style you choose.

        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 viewsis controlled entirely by the layout object. For example, the flow-based layout object uses supplementary viewsto implement header and footer views for sections in the collection view.

        Other noteworthy features of collection views include:

        A UICollectionViewControllerclass for managing the presentation of collection views in your appSupport 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

        For more information about using collection views to implement your user interface, seeCollection ViewProgramming Guide for iOS.

        UI State Preservation

        State preservation makes it easier for apps to restore their user interface to the state it was in when the userlast used it. Prior to iOS 6, apps were encouraged to write out information about their current interface statein the event that the app was terminated. Upon relaunch, the app could use this state to restore its interfaceand make it seem as if the app had never quit. State preservation simplifies this process by providing you withall of the core infrastructure for saving and restoring your app’s interface.

        Implementing state preservation still requires effort on your part to identify what parts of your interface tosave. In addition, the preservation and restoration processes can be customized to accommodate unforeseencircumstances, such as missing content during a subsequent relaunch or changes to your app’s UI.

        For more information about how to add state preservation support to your app, seeiOS App ProgrammingGuide.

        Auto Layout

        Auto layout improves upon the “springs and struts” model previously used to lay out the elements of a userinterface. With auto layout, you define rules for how to lay out the elements in your user interface. These rulesexpress a larger class of relationships and are more intuitive to use than springs and struts.

        The entities used in Auto Layout are Objective-C objects called constraints. This approach brings you a numberof 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 andrelative to its sibling views. A controller can override these values if something nonstandard is required.

        For more information about using auto layout, seeAuto Layout Guide.

        Data Privacy

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

        RemindersPhoto Library

        For contact, calendar, and reminder data, your app needs to be prepared to be denied access to these itemsand to adjust its behavior accordingly. If the user has not yet been prompted to allow access, the returnedstructure is valid but contains no records. If the user has denied access, the app receives aNULLvalue or nodata. If the user grants permission to the app, the system subsequently notifies the app that it needs to reloador revert the data.

        For the photo library, the existing interface supports the app being denied access.

        Your app can provide a description for how it intends to use the data in itsInfo.plistfile. That data is thendisplayed to the user when the system needs to prompt for access. For more information about the keys youneed to add to yourInfo.plistfile, see Information Property List Key Reference. For more information aboutaccessing specific kinds of data, see the respective framework reference.

        Additional Framework Enhancements

        In addition to the items discussed in the preceding sections, the following frameworks have additionalenhancements. For a complete list of new interfaces, seeiOS 6.0 API Diffs .

        UIKit Framework

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

        UIKit now supports state preservation for your app’s user interface; see“UI State Preservation”(page 30).Views now support constraint-based layout; see“Auto Layout”(page 30).

        The UICollectionViewclass (and its supporting classes and protocols) support the presentation ofordered collections of items; see“Collection Views”(page 29).

        UITextViewandUITextFieldnow support styled text using attributed strings.
        UIKit now includes support for drawing
        NSAttributedStringandNSMutableAttributedString

        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 morelogical 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 havechanged.

        New notifications provide information about the state of VoiceOver announcements.
        The
        UIActivityViewControllerclass adds support for sharing content via services like email, Twitter,

        and Facebook; see also, “Social Framework”(page 27).

        The UIDeviceclass adds a vendor-specific identifier.

        The UIImageclass includes new initialization methods for specifying the scale factor of an image.

        Appearance customization support has been added to theUIBarButtonItem,UIPageControl,UIPageViewController,UISwitch, andUIStepperclasses.

        The UITableViewclass includes the following changes:
        Support for a new
        UITableViewHeaderFooterViewclass implements the table’s headers and

        footers

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

        The UITableViewControllerclass 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 UIWebViewclass provides a way to disable the incremental rendering of web content.

        The UIViewControllerclass 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 UINavigationBarand incorporate your custom navigation bar into your app’snavigation interfaces.

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

        OpenGL ES

        OpenGL ES includes the following new extensions:

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

        The GL_APPLE_copy_texture_levelsextension builds on top of the functionality of theGL_EXT_texture_storageextension and allows a set of texture mipmaps to be copied from one textureto another.

        The GL_EXT_map_buffer_rangeextension improves performance when you only need to modify a subsetof a buffer object.

        The GL_APPLE_syncextension provides fine-grain synchronization to your app. It allows you to choose asubset of submitted OpenGL ES commands and block until those commands complete.

        The GL_EXT_shader_framebuffer_fetchextension is only available to OpenGL ES 2.0 applications andprovides access to the framebuffer data as an input to your fragment shader.

        These extensions are available on all devices capable of running iOS 6. As always, check for the existence ofan extension before using it in your application.

        Media Player Framework

        The MPVolumeViewclass now provides interfaces for customizing the appearance of the volume view. Youcan use these interfaces to change the images associated with the volume slider and routing button.

        For information about the classes of the Media Player framework, seeMedia Player Framework Reference.

        Image IO Framework

        The Image IO framework (ImageIO.framework) includes support for accessing EXIF and IPTC metadataproperties for images. You can access this metadata using functions associated with theCGImageSourceRefandCGImageDestinationRefopaque types.

        For information about the classes of the Image IO framework, seeImage I/O Reference Collection.

        iAd Framework

        The iAd framework (iAd.framework) supports a new medium rectangle banner size for ads on iPad devices.For information about the classes of the iAd framework, seeiAd Framework Reference.

        Foundation Framework

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

        The NSFileManagerclass includes theubiquityIdentityTokenmethod for determining the availabilityof iCloud, and theNSUbiquityIdentityDidChangeNotificationnotification for responding to auser logging into or out of iCloud, or changing accounts.

        The NSUUIDclass helps you create objects that represent various types of UUIDs (Universally UniqueIdentifiers). For example, you can create anNSUUIDobject with RFC 4122 version 4 random bytes, or youcan base it on an existing UUID string.

        The NSURLRequestclass lets you specify whether a request should be allowed to happen over a cellularnetwork.

        The NSStringclass has new methods for converting a string to uppercase, lowercase, or an initial capitalcase.

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

        External Accessory Framework

        The External Accessory framework (ExternalAccessory.framework) includes new interfaces for managingconnections to Bluetooth devices. Apps can now post an alert panel that lists the Bluetooth devices availablefor pairing. Support is also provided for waking previously paired accessories that do not automatically connect.

        For information about the classes of the External Accessory framework, seeExternal Accessory FrameworkReference.

        Event Kit Framework

        The Event Kit framework (EventKit.framework) includes the following enhancements:

        The framework supports the creation of reminders; see“Reminders”(page 28).

        Calendar and reminder events can now vend an external identifier that lets multiple devices refer to thesame event on the server. The server provides the actual identifier string, which is accessed using thecalendarItemExternalIdentifierproperty ofEKCalendarItem.

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

        Apps can now cancel editing programmatically from anEKEventEditViewControllerobject.
        For information about the classes of the Event Kit framework, see
        Calendar and Reminders Programming Guide.

        Core Video Framework

        The Core Video framework (CoreVideo.framework) adds support for two new pixel formats. These formatsprovide efficient storage for one-channel and two-channel images that interoperate with OpenGL ES. Forinformation about the functions of the Core Video framework, seeCore Video Framework Reference.

        Core Media Framework

        The Core Media framework (CoreMedia.framework) adds the CMClockRefandCMTimebaseReftypes,which define fundamental media time service behaviors. For information about the functions of the Core Mediaframework, seeCore Media Framework Reference.

        Core Location Framework

        The Core Location framework (CoreLocation.framework) includes the following changes.

        The CLLocationManagerobject now pauses the delivery of location events when the user has not movedfor an extended period of time. This behavior saves power by allowing the framework to turn off the GPSand other hardware. It is enabled by default but may be disabled by changing the value in thepausesLocationUpdatesAutomaticallyproperty of the location manager object.

        You can refine location accuracy based on usage by assigning an appropriate value to theactivityTypeproperty ofCLLocationManager. This property currently lets you distinguish between driving usageand fitness usage.

        The framework supports improved location accuracy while offline and driving.
        For information about the classes of the Core Location framework, see
        Core Location Framework Reference.

        Core Bluetooth Framework

        The Core Bluetooth framework (CoreBluetooth.framework) supports interacting with Bluetooth devicesin peripheral mode. Previously, an iOS device could only interact in central mode but it can advertise itself inperipheral mode and communicate with other iOS devices.

        For information about the classes of the Core Bluetooth framework, seeCore Bluetooth Framework Reference.

        Core Audio

        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 threadusing relatively larger time slices.

        The AudioQueueProcessingTap audio unit allows you to intercept the data in an audio queue and processit.

        For information about the audio technologies available in iOS, seeMultimedia Programming Guide. Forinformation about the new audio units, seeAudio Unit Component Services Reference.

        AV Foundation Framework

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

        The AVPlayerclass adds support for syncing playback to an external time source. A single player objectcan also play both HTTP Live Streams and file-based assets (including both local files and files that areprogressively downloaded). And you can use multipleAVPlayerLayerobjects to display the visual outputof the same player object.

        The new AVPlayerItemOutputclass works with an AVPlayerItemobject to obtain decoded videoframes during playback so that your app can process them.

        The AVAssetResourceLoaderclass allows you to insert a delegate object into the asset loading processand handle custom resource requests. This class works with theAVURLAssetclass.

        The AVAudioSessionclass now exposes information about the current audio route in use.
        The
        AVAudioMixInputParametersclass provides access to anMTAudioProcessingTapRefdata type,

        which can be used to access audio data before it is played, read, or exported.

        The AVAudioSessionclass 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 allowsrouting of audio to and from multiple audio hardware devices.

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

        The AVCaptureConnectionclass allows you to enable or disable support for video stabilization onincoming video.

        The AVCaptureMetadataOutputclass is a new class for intercepting metadata emitted by a captureconnection object.

        The AVMetadataFaceObjectis a new class that reports the face-detection data captured by anAVCaptureMetadataOutputobject.

        The AVTextStyleRuleclass is a new class for specifying style options for subtitles, closed captions, andother text-related media assets.

        The AVAudioPlayerclass can play audio items from the user’s iPod library using URLs obtained fromtheMPMediaLibraryclass. You can also set channel assignments using thechannelAssignmentsproperty.

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

        Ad Support Framework

        The Ad Support framework (AdSupport.framework) is a new framework that provides access to an identifierthat apps can use for advertising purposes. This framework also provides a flag that indicates whether the userhas opted out of ad tracking. Apps are required to read and honor the opt-out flag before trying to access theadvertising identifier.

        For more information about this framework, seeAd Support Framework Reference.

        Accelerate Framework

        The Accelerate framework (Accelerate.framework) includes new vector-scalar power functions, vDSPfunctions, discrete cosine transform functions, SSE-related vector functions, sine functions, and vImage functions.

        For information about the functions of the Accelerate framework, seeAccelerate Framework Reference.

        iOS 5.1

        This article summarizes the key developer-related features introduced in iOS 5.1. This version of the operatingsystem runs on current iOS-based devices. In addition to describing the key new features, this article lists thedocuments that describe those features in more detail.

        For late-breaking news and information about known issues, seeiOS 5.1 Release Notes. For the complete listof new APIs added in iOS 5.1, seeiOS 5.1 API Diffs.

        Dictation Support in Text Input Views

        On supported devices, iOS automatically inserts recognized phrases into the current text view when the userhas chosen dictation input. The newUIDictationPhraseclass (declared in UITextInput.h) provides youwith a string representing a phrase that a user has dictated. In the case of ambiguous dictation results, thenew class provides an array containing alternative strings. New methods in theUITextInputprotocol allowyour app to respond to the completion of dictation.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.38

        iOS 5.0

        This article summarizes the key developer-related features introduced in iOS 5.0. This version of the operatingsystem runs on current iOS-based devices. In addition to describing the key new features, this article lists thedocuments that describe those features in more detail.

        For late-breaking news and information about known issues, seeiOS 5.0 Release Notes. For the complete listof new APIs added in iOS 5.0, seeiOS 5.0 API Diffs.

        iCloud Storage APIs

        The iCloud storage APIs let your app write user documents and data to a central location and access thoseitems from all of a user’s computers and iOS devices. Making a user’s documents ubiquitous using iCloudmeans that a user can view or edit those documents from any device without having to sync or transfer filesexplicitly. Storing documents in a user’s iCloud account also provides a layer of security for that user. Even ifa user loses a device, the documents on that device are not lost if they are in iCloud storage.

        There are two ways that apps can take advantage of iCloud storage, each of which has a different intendedusage:

        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.

        Most apps will use iCloud document storage to share documents from a user’s iCloud account. This is thefeature that users think of when they think of iCloud storage. A user cares about whether documents are sharedacross devices and can see and manage those documents from a given device. In contrast, the iCloud key-valuedata store is not something a user would see. It is a way for your app to share small amounts of data (up to aper-app total of 1 MB and a maximum of 1,024 keys) with other instances of itself. Apps can use this featureto 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.

        For information on how to use iCloud document and key-value data storage, seeiCloud Design Guide.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.39

        iOS 5.0

        iCloud Backup

        iCloud Backup

        Users can now opt to have their apps and app data backed up directly to their iCloud account, making it easierto restore apps to their most recent state. Having data backed up in iCloud makes it easy for a user to reinstallthat data to a new or existing iOS device. However, because the amount of space in a user’s iCloud account islimited, apps must be even more selective about where they store files.

        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, everythingin the Documentsdirectory and most (but not all) of your app’sLibrarydirectory. To minimize the amountof data stored in the user’s iCloud account, developers are encouraged to put more files in theLibrary/Cachesdirectory, especially if those files can be easily re-created or obtained in another way.

        Note:AnydocumentsthatyourappstoresexplicitlyiniCloud(usingtheiCloudstorageAPIs)arenot backed up with your app. (Those documents are already stored in the user’s iCloud account andtherefore do not need to be backed up separately.)

        For information on which directories are backed up, and for information about iCloud document storage, seeiOS App Programming Guide.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.40

        iOS 5.0

        Automatic Reference Counting

        Automatic Reference Counting

        Automatic Reference Counting (ARC)is a compiler-level feature that simplifies the process of managing thelifetimes of Objective-C objects. Instead of you having to remember when to retain or release an object, ARCevaluates the lifetime requirements of your objects and automatically inserts the appropriate method calls atcompile time.

        Reference counting manually

        Automatic Reference Counting

        retain/release code

        {app_code}

        retain/release code

        {app_code}

        retain/release code

        {app_code}

        retain/release code

        {app_code}

        retain/release code

        {app_code}

        retain/release code

        {app_code}

        {app_code}

        {app_code}

        {app_code}

        {app_code}

        Time
        to produce

        Time
        to produce

        To be able to deliver these features, ARC imposes some restrictions—primarily enforcing some best practicesand disallowing some other practices:

        Do not call the retain,release,autorelease, ordeallocmethods in your code.

        In addition, you cannot implement customretainorreleasemethods.

        Because you do not call thereleasemethod, there is often no need to implement a customdeallocmethod—the compiler synthesizes all that is required to relinquish ownership of instance variables. Youcan provide a custom implementation ofdeallocif you need to manage other resources.

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.41

        iOS 5.0

        Automatic Reference Counting

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

        You cannot use NSAutoreleasePoolobjects.
        Instead, you must use a new
        @autoreleasepoolkeyword to mark the start of an autorelease block. The

        contents of the block are enclosed by curly braces, as shown in the following example:

        @autoreleasepool
        {
        
           // Your code here
        }
        

        ARC encourages you to think in terms of object graphs, and the relationships between objects, rather than interms of retain and release. For this reason, ARC introduces new lifetime qualifiers for objects, including zeroingweak references. The value of a zeroing weak reference is automatically set tonilif the object to which itpoints is deallocated. There are qualifiers for variables, and newweakandstrongdeclared property attributes,as illustrated in the following examples:

        // The following declaration is a synonym for: @property(retain) MyClass *myObject;@property(strong) MyClass *myObject;

        // The following declaration is similar to "@property(assign) MyOtherClass
        *delegate;"
        
        // except that if the MyOtherClass instance is deallocated,
        // the property value is set to nil instead of remaining as a dangling pointer
        @property(weak) MyOtherClass *delegate;
        

        Xcode provides migration tools to help convert existing projects to use ARC. For more information about howto perform this migration, seeWhat's New in Xcode. For more information about ARC itself, seeTransitioningto ARC Release Notes.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.42

        iOS 5.0

        Storyboards

        Storyboards

        Storyboards are the new way to define your app’s user interface. In the past, you used nib files to define youruser interface one view controller at a time. A storyboard file captures your entire user interface in one placeand 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.

        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.plistfile to use storyboards:

          Add the UIMainStoryboardFilekey and set its value to the name of your storyboard file.

          Remove the existing NSMainNibFilekey. (Storyboards replace the main nib file.)

        2. Create and configure the storyboard file in Xcode; see“Creating Storyboard Files”(page 43).

        3. Update your view controllers to handle storyboard transitions; see“Preparing to Transition to a New ViewController”(page 44).

        4. If you ever need to present a view controller manually (perhaps to support motion-related events), usethe storyboard classes to retrieve and present the appropriate view controller; see“Presenting StoryboardView Controllers Programmatically”(page 44).

        Apps can use a single storyboard file to store all of their view controllers and views. At build time, InterfaceBuilder takes the contents of the storyboard file and divides it up into discrete pieces that can be loadedindividually for better performance. Your app never needs to manipulate these pieces directly, though. All youmust do is declare the main storyboard in your app’sInfo.plistfile. UIKit handles the rest.

        Creating Storyboard Files

        You use Interface Builder to create storyboard files for your app. Most apps need only one storyboard file, butyou can create multiple storyboard files if you want. Every storyboard file has a view controller known as theinitial view controller. This view controller represents the entry point into the storyboard. For example, inyour app’s main storyboard file, the initial view controller would be the first view controller presented by yourapp.

        Each view controller in a storyboard file manages a single scene. For iPhone apps, ascenemanages one screen’sworth of content, but for iPad apps the content from multiple scenes can be on screen simultaneously. To addnew scenes to your storyboard file, drag a view controller from the library to the storyboard canvas. You canthen add controls and views to the view controller’s view just as you would for a nib file. And as before, youcan configure outlets and actions between your view controller and its views.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.43

        iOS 5.0

        Storyboards

        When you want to transition from one view controller to another, Control-click a button, table view cell, orother trigger object in one view controller, and drag to the view controller for a different scene. Draggingbetween view controllers creates a segue, which appears in Interface Builder as a configurable object. Seguessupport all of the same types of transitions available in UIKit, such as modal transitions and navigation transitions.You can also define custom transitions and transitions that replace one view controller with another.

        For more information about using Interface Builder to configure your storyboard files, seeWhat's New in Xcode.

        Preparing to Transition to a New View Controller

        Whenever a user triggers a segue in the current scene, the storyboard runtime calls theprepareForSegue:sender:method of the current view controller. This method gives the current viewcontroller an opportunity to pass any needed data to the view controller that is about to be displayed. Whenimplementing your view controller classes, you should override this method and use it to handle thesetransitions.

        For more information about implementing the methods of theUIViewControllerclass, see UIViewControllerClass Reference.

        Presenting Storyboard View Controllers Programmatically

        Although the storyboard runtime usually handles transitions between view controllers, you can also triggersegues programmatically from your code. You might do so when it is not possible to set up the segue entirelyin Interface Builder—for example, when doing so involves 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 destinationview controller (perhaps triggered by some other control in the view controller), you can trigger that segueprogrammatically using the performSegueWithIdentifier:sender:method ofUIViewController.

        If there is no segue between the view controllers but the destination view controller is defined in thestoryboard file, first load the view controller programmatically using theinstantiateViewControllerWithIdentifier:method of UIStoryboard. Then present the viewcontroller 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 asdescribed inView Controller Programming Guide for iOS.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.44

        iOS 5.0

        Newsstand Support

        Newsstand Support

        Newsstand provides a central place for users to read magazines and newspapers. Publishers who want todeliver their magazine and newspaper content through Newsstand can create their own iOS apps using theNewsstand Kit framework (NewsstandKit.framework), although doing so is not required. A big advantageof the Newsstand Kit framework, however, is that you can use it to initiate background downloads of newmagazine and newspaper issues. After you start a download, the system handles the download operation andnotifies your app when the new content is available.

        Unlike other iOS apps, Newsstand apps appears only in Newsstand itself, not in a user’s Home screen. Andinstead of displaying an app icon, the app typically displays the cover of their most recent issue, with someadditional adornments provided by Newsstand. When the user taps that cover art, your app launches normallyto present the current issue or any back issues that were downloaded and are still available.

        Note:NewsstandappsmustincludetheUINewsstandAppkeyintheirInfo.plistfiletoindicatethat they support Newsstand. For more information about this key, see Information Property List KeyReference.

        Creating an app that uses Newsstand Kit requires some interplay between the actual app and the contentservers that you manage. Your servers are responsible for notifying the app when new content is available,typically using a push notification. If your Newsstand app includes the UIBackgroundModeskey with thenewsstand-contentvalue in itsInfo.plistfile, your Newsstand app is launched in the background sothat it can start downloading the latest issue. The download process itself is managed by the system, whichnotifies your app when the content is fully downloaded and available.

        When your server is alerting your app of a new issue, that server should include thecontent-availableproperty (with a value of1) in the JSON payload. This property tells the system that it should launch your appso that it can begin downloading the new issue. Apps are launched and alerted to new issues once in a 24-hourperiod at most, although if your app is running when the notification arrives, it can begin downloading thecontent immediately.

        In addition to your server providing content for each new issue, it should also provide cover art to present inNewsstand when that issue is available. This cover art is displayed in place of the app’s default icon, which isspecified by the Newsstand-specific icons in the CFBundleIconskey of your app’s Info.plistfile. Coverart gives users a more visual cue that a new issue is available. Your app can also add a badge to new issues.

        For information about the classes you use to manage Newsstand downloads, seeNewsstand Kit FrameworkReference. For information about how to use push notifications to notify your apps, seeLocal and PushNotification Programming Guide. For more information about setting up Newsstand subscriptions, seeIn-AppPurchase Programming Guide.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.45

        iOS 5.0

        AirPlay Improvements

        AirPlay Improvements

        AirPlay lets users stream audio and video from an iOS-based device to AirPlay–enabled devices such as televisionsand audio systems. In iOS 5, developers can now use AirPlay to present app content on a nearby Apple TV 2.Users can now mirror the content of an iPad 2 to an Apple TV using AirPlay for any app. And developers whowant to display different content (instead of mirroring) can assign a new window object to anyUIScreenobjects connected to an iPad 2 via AirPlay.

        In addition, you can now take advantage of AirPlay in the following ways:

        Apps that use AV Foundation can now use theAVPlayerclass to stream audio and video content overAirPlay; seeAV 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 UIWebViewclass now supports the presentation of multimedia content over AirPlay. This support isenabled by default, but you can opt out of it if you want to.

        Note:IniOS5,AirPlayisenabledbydefaultforallobjectsthatsupportit.Ifyoudonotwantyourapp’s content to be playable over AirPlay, you must opt out explicitly.

        For more information about delivering content over AirPlay, and the support media formats, seeAirPlayOverview.

        New Frameworks

        In iOS 5.0, there are several new frameworks you should investigate.

        GLKit Framework

        The GLKit framework (GLKit.framework) contains a set of Objective-C based utility classes that simplify theeffort required to create an OpenGL ES 2.0 app. GLKit provides support for four key areas of app development:

        The GLKViewandGLKViewControllerclasses provide a standard implementation of an OpenGLES–enabled view and associated rendering loop. The view manages the underlying framebuffer object onbehalf of the app; your app just draws to it.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.46

        iOS 5.0

        New Frameworks

        The GLKTextureLoaderclass provides image conversion and loading routines to your app, allowing itto 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 whenthe texture is loaded into your context.

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

        The GLKBaseEffect,GLKSkyboxEffect, andGLKReflectionMapEffectclasses provide configurablegraphics shaders that implement commonly used graphics operations. In particular, theGLKBaseEffectclass implements the lighting and material model found in the OpenGL ES 1.1 specification, simplifyingthe effort required to migrate an app from OpenGL ES 1.1 to OpenGL ES 2.0.

        For information about the classes of the GLKit framework, seeGLKit Framework Reference.

        Core Image Framework

        The Core Image framework (CoreImage.framework) provides a powerful set of built-in filters for manipulatingvideo and still images. You can use the built-in filters for everything from simple operations (like touching upand correcting photos) to more advanced operations (like face and feature detection). The advantage of usingthese filters is that they operate in a nondestructive manner so that your original images are never changeddirectly. In addition, Core Image takes advantage of the available CPU and GPU processing power to ensurethat operations are fast and efficient.

        The CIImageclass provides access to a standard set of filters that you can use to improve the quality of aphotograph. To create other types of filters, you can create and configure aCIFilterobject for the appropriatefilter type.

        For information about the classes and filters of the Core Image framework, seeCore Image Reference Collection.

        Twitter Framework

        The Twitter framework (Twitter.framework) provides support for sending Twitter requests on behalf of theuser and for composing and sending tweets. For requests, the framework handles the user authentication partof the request for you and provides a template for creating the HTTP portion of the request. (Refer to theTwitter API for populating the content of the request.) The composition of tweets is accomplished using theTWTweetComposeViewControllerclass, which is a view controller that you post with your proposed tweetcontent. This class gives the user a chance to edit or modify the tweet before sending it.

        Users control whether an app is allowed to communicate with Twitter on their behalf using Settings. TheTwitter framework also works in conjunction with the Accounts framework (Accounts.framework) to accessthe user’s account.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.47

        iOS 5.0

        App Design-Level Improvements

        For information about the classes of the Twitter framework, seeTwitter Framework Reference. For informationabout the Accounts framework, see“Accounts Framework”(page 48).

        Accounts Framework

        The Accounts framework (Accounts.framework) provides a single sign-on model for certain user accounts.Single sign-on improves the user experience, because apps no longer need to prompt a user separately forlogin information related to an account. It also simplifies the development model for you by managing theaccount authorization process for your app. In iOS 5.0, apps can use this framework in conjunction with theTwitter framework to access a user’s Twitter account.

        For more information about the classes of the Accounts framework, seeAccounts Framework Reference.

        Generic Security Services Framework

        The Generic Security Services framework (GSS.framework) provides a standard set of security-related servicesto iOS apps. The basic interfaces of this framework are specified in IETFRFC 2743andRFC 4401. In addition tooffering the standard interfaces, iOS includes some additions for managing credentials that are not specifiedby the standard but that are required by many apps.

        For information about the interfaces of the GSS framework, see the header files.

        Core Bluetooth

        The Core Bluetooth framework (CoreBluetooth.framework) allows developers to interact specifically withBluetooth Low-Energy ("LE") accessories. The Objective-C interfaces of this framework allow you to scan for LEaccessories, connect and disconnect to ones you find, read and write attributes within a service, register forservice and attribute change notifications, and much more.

        For more information about the interfaces of the Core Bluetooth framework, see the header files.

        App Design-Level Improvements

        The following sections describe new capabilities that you can incorporate into the model, view, and controllerlayers of your app.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.48

        iOS 5.0

        App Design-Level Improvements

        Document Support

        Cocoa Touch now includes aUIDocumentclass for managing the data associated with user documents. If youare implementing a document-based app, this class reduces the amount of work you must do to manage yourdocument data. In addition to providing a container for all of your document-related data, theUIDocumentclass provides built-in support for a number of features:

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

        Support for coordinated reading and writing of documents, which is required for documents in iCloudstorage.

        Safe saving of document data by writing data first to a temporary file and then replacing the currentdocument 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 aUIManagedDocumentsubclass tomanage interactions with documents in the database.

        If you are implementing an app that supports iCloud storage, the use of document objects makes the job ofstoring files in iCloud much easier. Document objects are file presenters and handle many of iCloud-relatednotifications that you might otherwise have to handle yourself. For more information about supporting iCloudstorage, see“iCloud Storage APIs”(page 39).

        For information about the UIDocumentclass, seeUIDocument Class Reference. For information about theUIManagedDocumentclass, see UIManagedDocument Class Reference.

        Data Protection Improvements

        Introduced in iOS 4.0, data protection lets you store app and user data files on disk in an encrypted format sothat they can be accessed only when a user’s device is unlocked. In iOS 5.0, you now have more flexibilityregarding when your app can access protected files.

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

        Using the NSFileProtectionCompleteUntilFirstUserAuthenticationoption, your app cannotaccess the file while the device is booting or until the user unlocks the device. After the user unlocks thedevice for the first time, you can access the file even if the user subsequently locks the device again.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.49

        iOS 5.0

        App Design-Level Improvements

        You should protect files as soon as possible after creating them. For information about how to protect files,seeiOS 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 andfeel. For example, you might use these customizations to make the standard system controls match the brandingfor 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 varietyof 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 usingan appearance proxy.

        An appearance proxy is an object you use to modify the default appearance of visual objects such as viewsand bar items. Classes that adopt theUIAppearanceprotocol support the use of an appearance proxy.To modify the default appearance of such a class, retrieve its proxy object using theappearanceclassmethod and call the returned object’s methods to set new default values. A proxy object implementsthose methods and properties from its proxied class that are tagged with theUI_APPEARANCE_SELECTORmacro. For example, you can use a proxy object to change the default tint color (through theprogressTintColorortrackTintColorproperties) of theUIProgressViewclass.

        If you want to set a different default appearance based on how a given object is used in your app, youcan do so using the proxy object returned by theappearanceWhenContainedIn:method instead. Forexample, you use this proxy object to set specific default values for a button only when it is containedinside a navigation bar.

        Any changes you make with a proxy object are applied, at view layout time, to all instances of the classthat exist or that are subsequently created. However, you can still override the proxy defaults later usingthe methods and properties of a given instance.

        For information about the methods for customizing the appearance of a class, see the description of that classinUIKit Framework Reference.

        Container View Controller Support

        The UIViewControllerclass now allows you to define your own custom container view controllers andpresent content in new and interesting ways. Examples of existing container view controllers includeUINavigationController,UITabBarController, andUISplitViewController. These view controllers

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.50

        iOS 5.0

        Xcode Tools

        mix custom content with content provided by one or more separate view controller objects to create a uniquepresentation for 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.

        For more information about view controllers and the methods you need to implement for container viewcontrollers, seeUIViewController Class Reference.

        Settings

        Apps that deliver custom preferences can now use a new radio group element. This element is similar to themultivalue element for selecting one item from a list of choices. The difference is that the radio group elementdisplays its choices inline with your preferences instead of on a separate page.

        For more information about displaying app preferences using the Settings app, see “App-Related Resources”iniOS App Programming Guide. For information about the property-list keys you use to build your Settingsbundle, seeSettings Application Schema Reference.

        Xcode Tools

        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, seeWhat's New in Xcode.

        Xcode Improvements

        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 toconvert targets to use ARC. (For more information about ARC and about how to use it in your apps, see“Automatic Reference Counting” (page 41).)

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

        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 debuggingor 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 ESapps. You can now use Xcode to do the following for your OpenGL ES apps:

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.51

        iOS 5.0

        Xcode Tools

        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 frameboundaries, and so on.

        UI Automation Enhancements

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

        The UIATargetobject can now simulate rotate gestures and location changes.

        The UIAHostobject supports executing a task from the Instruments app itself.

        The UIAElementobject can now simulate a rotate gesture centered on the element.

        Several functions that were previously available only inUIAWindowandUIAPopoverwere moved toUIAElementbecause they are common to all element objects.

        The UIAKeyboardobject now supports performing a sequence of keyboard taps to simulate the typingof a string.

        For information about the enhancements to the Automation instrument, seeInstruments New Features UserGuide. For information about the JavaScript objects and commands that you use in your scripts, seeUIAutomation 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 affectingapp 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. Withthis 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 requestinformation.

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

        For information about using these new instruments, seeInstruments New Features User Guide

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.52

        iOS 5.0

        Additional Framework Enhancements

        Additional Framework Enhancements

        In addition to the items discussed in the preceding sections, the following frameworks have additionalenhancements. For a complete list of new interfaces, seeiOS 5.0 API Diffs .

        UIKit

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

        The UIViewControllerclass can now be used to create custom container view controllers; see“ContainerView Controller Support”(page 50).

        The UIKit framework provides support for loading and using storyboards; see“Storyboards”(page 43).Bars and bar button items can now be tinted and customized for your app; see“Custom Appearance for

        UIKit Controls”(page 50).
        The
        UIPageViewControllerclass is a new container view controller for creating page-turn transitions

        between view controllers.

        The UIReferenceLibraryViewControllerclass adds support for presenting a custom dictionaryservice to the user.

        The UIImagePickerControllerclass supports new options for specifying the quality of video recordings.TheUIStepperclass 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
        UIApplicationclass now reports the language directionality of the running app.

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

        The UIScreenclass lets you specify overscan compensation behaviors for video delivered over AirPlayor through an attached HDMI cable. You can also programmatically set a screen’s brightness.

        The UIScrollViewclass now exposes its gesture recognizers so that you can configure them moreprecisely for your app.

        The UISegmentedControlclass now supports proportional segment widths.
        The
        UIAlertViewclass now supports password-style text entry and special configurations for entering

        text securely.
        The
        UIColorclass includes support for Core Image and new methods to retrieve individual color values.

        The UIImageclass includes support for Core Image, support for stretching an image by tiling part of itscontent, and support for looping animations.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.53

        iOS 5.0

        Additional Framework Enhancements

        The UITextInputTraitsprotocol adds support for a Twitter-specific keyboard and separate spell-checkingbehavior.

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

        The UIAccessibilityReadingContentprotocol allows you to provide a continuous, page-turningreading experience to VoiceOver users.

        The UIAccessibilityIdentificationprotocol allows you to uniquely identify elements in your appso that you can refer to them in automation scripts.

        The UIWebViewclass automatically supports the presentation of multimedia content over AirPlay. Youcan opt out of this behavior by changing the value in themediaPlaybackAllowsAirPlayproperty ofthe class. This class also exposes ascrollViewproperty so that you can access the scrolling propertiesof your web interfaces.

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

        OpenGL ES

        OpenGL ES (OpenGLES.framework) now includes the following new extensions:

        The EXT_debug_labelandEXT_debug_markerextensions allow you to annotate your OpenGL ES drawingcode with information specific to your app. The OpenGL ES Performance Detective, the OpenGL ESDebugger, and the OpenGL ES Analyzer tools provided by Xcode all take advantage of these annotations.

        The EXT_color_buffer_half_floatextension allows 16-bit floating point formats to be specified for a framebuffer's color renderbuffer.

        The EXT_occlusion_query_booleanextension allows your app to determine whether any pixels would bedrawn by a primitive or by a group of primitives.

        The EXT_separate_shader_objectsextension allows your app to specify separate vertex and fragmentshader programs.

        The EXT_shadow_samplersextension provides support for shadow maps.
        The
        EXT_texture_rgextension 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.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.54

        iOS 5.0

        Additional Framework Enhancements

        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 buffersthat 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.

        For information about the OpenAL interfaces, see the header files.

        Message UI

        The Message UI framework (MessageUI.framework) adds a new notification for tracking changes to thedevice’s ability to send text messages. For information about the interfaces of the Message UI framework, seeMessage UI Framework Reference.

        Media Player

        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 theairPlayVideoActiveproperty of theMPMoviePlayerControllerclass.

        Apps can now use the framework to play content from iTunes University.
        For information about the classes in the Media Player framework, see
        Media Player Framework Reference.

        Map Kit

        The Map Kit framework (MapKit.framework) supports the ability to use heading data to rotate a map basedon the user’s current orientation. As you can with the Maps app, you can configure your map view to scrollthe map according to the user’s current location. For example, a walking tour app might use this to show theuser their current location on the tour.

        For information on the interfaces you use to implement map scrolling and rotation, seeMap Kit FrameworkReference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.55

        iOS 5.0

        Additional Framework Enhancements

        Note:IfyouarecurrentlyusingMapKitforgeocoding,youshouldswitchtousingtheCoreLocationframework for that feature; see“Core Location”(page 58).

        iAd

        The iAd framework (iAd.framework) provides new callback methods for developers who use multiple adnetworks and want to be notified when a new ad is available. ThebannerViewWillLoadAd:method (definedin the ADBannerViewDelegateprotocol) is called when a banner has confirmed that an ad is available butbefore the ad is fully downloaded and ready to be presented. TheinterstitialAdWillLoad:method(defined in the ADInterstitialAdDelegateprotocol) offers similar behavior for interstitial ads.

        For information about the classes of the iAd framework, seeiAd Framework Reference.

        Game Kit

        The Game Kit framework (GameKit.framework) and Game Center now have the following features:

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

        Your game can now adjust the default leaderboard (implemented by theGKLeaderboardclass) shownto each player. If your game does not change the default leaderboard for a player, that player sees theleaderboard configured for your app in iTunes Connect.

        The GKNotificationBannerclass implements a customizable banner similar to the banner shown toplayers when they log in to Game Center. Your game may use this banner to display messages to theplayer.

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

        A GKMatchmakerViewControllerobject can now add players to an existing match in addition tocreating a new match.

        The GKMatchDelegateprotocol now includes a method to reconnect devices when a two-player matchis disconnected.

        For information about the classes of the Game Kit framework, seeGame Kit Framework Reference.

        Foundation

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.56

        iOS 5.0

        Additional Framework Enhancements

        The NSFileManagerclass includes new methods for moving a file to a user’s iCloud storage.
        The new
        NSFileCoordinatorclass andNSFilePresenterprotocol implement now locking support

        and notifications when manipulating documents in iCloud.
        The new
        NSFileVersionclass reports and manages conflicts between different versions of a file in iCloud.TheNSURLclass includes new methods and constants to support syncing items to a user’s iCloud storage.

        The new NSMetadataQueryclass supports attributes for items synced to a user’s iCloud storage. Severalother metadata-related classes were also added, includingNSMetadataItem,NSMetadataQueryResultGroup, and NSMetadataQueryAttributeValueTuple.

        The new NSJSONSerializationclass is a new class that supports back-and-forth conversions betweenJSON dataand Foundation types.

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

        This framework now includes theNSFileWrapperclass for managing file packages—that is, filesimplemented as an opaque directory.

        The new NSOrderedSetcollection class offers the semantics of sets, whereby each element occurs atmost 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 onNSObject.For information about the classes of the Foundation framework, seeFoundation Framework Reference.

        External Accessory

        Apps that use the External Accessory framework to communicate with external accessories can now ask to bewoken up if the app is suspended when its accessory delivers new data. Including theUIBackgroundModeskey with theexternal-accessoryvalue in your app’sInfo.plistfile keeps your accessory sessions openeven 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 newdata. This type of behavior is designed for apps that work with heart-rate monitors and other types of accessoriesthat need to deliver data at regular intervals.

        For more information about theUIBackgroundModeskey, see Information Property List Key Reference. Forinformation about interacting with external accessories, seeExternal Accessory Programming Topics.

        Event Kit and Event Kit UI

        The Event Kit framework (EventKit.framework) includes the following enhancements:

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.57

        iOS 5.0

        Additional Framework Enhancements

        The class hierarchy has been restructured. There is now a common base class calledEKObjectand portionsof the EKEventclass have been moved into a new base class calledEKCalendarItem.

        With the EKEventStoreclass, you can now create and delete calendars programmatically, fetch calendarsbased on their identifier, save and remove events in batches, and trigger a programmatic refresh of calendardata.

        The new EKSourceclass represents the source for creating new calendars and events.
        The
        EKCalendarclass now provides access to a calendar’s UUID, source, and other attributes.

        The Event Kit UI framework (EventKitUI.framework) now includes the EKCalendarChooserclass, whichprovides a standard way for selecting from the user’s iCal calendars.

        For information about the classes of the Event Kit framework, seeEvent Kit Framework Reference. For informationabout the classes of the Event Kit UI framework, seeEvent Kit UI Framework Reference.

        Core Motion

        The Core Motion framework (CoreMotion.framework) now supports reporting heading information andmagnetometer data for devices that have the corresponding hardware.

        For information about the classes of the Core Motion framework, seeCore Motion Framework Reference.

        Core Location

        The Core Location framework (CoreLocation.framework) now includes support for both forward andreverse geocoding location data. This support allows you to convert back and forth between a set of mapcoordinates and information about the street, city, country (and so on) at that coordinate.

        For information about the classes of the Core Location framework, seeCore Location Framework Reference.

        Core Graphics

        The Core Graphics framework (CoreGraphics.framework) includes some new interfaces to support thecreation of paths. Specifically, there are new interfaces for creating paths with an ellipse or rectangle and foradding arcs to existing paths.

        For more information about the Core Graphics interfaces, seeCore Graphics Framework Reference.

        Core Data

        The Core Data framework includes the following enhancements:

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.58

        iOS 5.0

        Additional Framework Enhancements

        Core Data provides integration with the iOS document architecture and iCloud storage. TheUIManagedDocumentclass is a concrete subclass ofUIDocumentthat uses a Core Data persistent storefor document data storage.

        For apps built for iOS 5.0 or later, persistent stores now store data by default in an encrypted format ondisk. The default protection level prevents access to the data until after the user unlocks the device forthe first time. You can change the protection level by assigning a custom value to theNSPersistentStoreFileProtectionKeykey when configuring your persistent stores. For additionalinformation about the data protection that are new in iOS 5.0, see“Data Protection Improvements”(page49).

        Core Data formalizes the concurrency model for theNSManagedObjectContextclass 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. TheNSConfinementConcurrencyTypeoptionprovides the same behavior that was present on versions of iOS prior to 5.0 and is the default. Whensending messages to a context created with a queue association, you must use theperformBlock:orperformBlockAndWait:method if your code is not already executing on that queue (for the main queuetype) or within the scope of aperformBlock...invocation (for the private queue type). Within theblocks passed to those methods, you can use the methods ofNSManagedObjectContextfreely. TheperformBlockAndWait:method supports API reentrancy. TheperformBlock:method includes anautorelease pool and calls theprocessPendingChangesmethod upon completion.

        You can create nested managed object contexts, in which the parent object store of a context is anothermanaged object context rather than the persistent store coordinator. This means that fetch and saveoperations are mediated by the parent context instead of by a coordinator. This pattern has a number ofusage scenarios, including performing background operations on a second thread or queue and managingdiscardable 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 ofaccessing a context (by passing a context from one view controller to the next) rather than retrieving itdirectly from the app delegate.

        Managed objects support two significant new features: ordered relationships, and external storage forattribute values. If you specify that the value of a managed object attribute may be stored as an externalrecord, Core Data heuristically decides on a per-value basis whether it should save the data directly in thedatabase or store a URI to a separate file that it manages for you.

        There are two new classes,NSIncrementalStoreandNSIncrementalStoreNode, that you can useto implement support for nonatomic persistent stores. The store does not have to be a relationaldatabase—for example, you could use a web service as the back end.

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.59

        iOS 5.0

        Additional Framework Enhancements

        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 formanaging 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.

        For information about the audio technologies available in iOS, seeMultimedia Programming Guide. Forinformation about the new audio units, seeAudio 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 oftransmitting video over AirPlay using theallowsAirPlayVideoproperty of the AVPlayerclass.

        New properties on the AVPlayerItemclass indicate whether the item supports fast-forwarding orrewinding of the content.

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.60

        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 letsyou create music instruments, for which you can provide your own sounds. The new AUFilePlayer unit letsyou 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 mixerthat remembers fader positions and changes.

        You can now use the advanced features of Apple Core Audio Format files in iOS. For example, you mightcreate 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.

        iOS 5.0

        Additional Framework Enhancements

        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 librarySupport for adding assets to albums
        The ability to get an aspect ratio thumbnail for an assetThe ability to modify saved assets

        For information about the classes of the Assets Library framework, seeAssets Library Framework Reference.

        Address Book

        The Address Book framework adds support for importing and exporting vCard data. It also adds new keys toassociate social network affiliations with a user record.

        For more information about the new features in the Address Book framework, seeAddress Book FrameworkReference for iOS.

        Security

        The Security framework (Security.framework) now includes the Secure Transport interfaces, which areApple’s implementation of the SSL/TLS protocols. You can use these interfaces to configure and manage SSLsessions, manage ciphers, and manage certificates.

        For information about the Secure Transport interfaces, see theSecureTransport.hheader file of the Securityframework.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.61

        iOS 4.3

        This article summarizes the key developer-related features introduced in iOS 4.3. This version of the operatingsystem runs on all iOS-based devices. In addition to describing the key new features, this article lists thedocuments that describe those features in more detail.

        For the latest updates and information, you should also seeiOS 4.3 Release Notes. For the complete list of newAPIs added in iOS 4.3, seeiOS 4.3 API Diffs.

        AirPlay Video Support

        Support for playing video using AirPlay is included in theMPMoviePlayerControllerclass. This supportallows you to play video-based content on AirPlay–enabled hardware such as Apple TV. When theallowsAirPlayproperty of an active MPMoviePlayerControllerobject is set toYESand the device is inrange of AirPlay–enabled hardware, the movie player presents the user with a control for sending the videoto that hardware. (That property is set toNOby default.) Supported formats include:

        H.264 video with AAC audio
        HTTP streaming, both live and on demandprogressive download content
        local content

        For web-based content, you can enable AirPlay Video in the QuickTime Plug-in or HTML5 video element asfollows:

               airplay="allow"
        

        airplay="deny"(Default)

        For example: <embed src="movie.mov" width="320" height="240" airplay="allow">

        x-webkit-airplay="allow"x-webkit-airplay="deny"(Default)

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.62



        QTPlug-in:

        HTML5 video element:

        iOS 4.3

        Framework Enhancements

        For example: <video controls width="640" height="368" x-webkit-airplay="allow"src="content/side_with_the_seeds.mov"> </video>

        For more information about using theMPMoviePlayerControllerclass to play video, seeMPMoviePlayerController Class Reference.

        Framework Enhancements

        The following sections highlight the significant changes to frameworks and technologies in iOS 4.3. For acomplete list of all new interfaces available in the system, seeiOS 4.3 API Diffs .

        AV Foundation

        The AV Foundation framework includes the following enhancements:

        The AV Foundation framework added theAVPlayerItem,AVPlayerItemAccessLogEvent, andAVPlayerItemErrorLogEventclasses for tracking network playback statistics.

        The AVMetadataItemclass added support for loading key data asynchronously.
        For information about the classes of the UIKit framework, see
        AV Foundation Framework Reference.

        Core Audio Frameworks

        The Audio Unit and Audio Toolbox frameworks include the following enhancements:

        The AudioUnitParameterHistoryInfostruct (in the Audio Unit framework) along with supportingaudio unit properties adds the ability to track and use parameter automation history.

        The ExtendedAudioFormatInfostruct (in the Audio Toolbox framework) lets you specify which codecto use when accessing thekAudioFormatProperty_FormatListproperty.

        The kAFInfoDictionary_SourceBitDepthdictionary key and thekAudioFilePropertySourceBitDepthproperty (in the Audio Toolbox framework) provide access tothe bit depth of an audio stream.

        The kAudioConverterErr_NoHardwarePermissionresult code (in the Audio Toolbox framework)indicates that a request to create a new audio converter object cannot be satisfied because the applicationdoes not have permission to use the requested hardware codec.

        For information about the functions and types of the Audio Unit framework, seeAudio Unit Framework Reference.For information about the functions and types of the Audio Toolbox framework, seeAudio Toolbox FrameworkReference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.63

        iOS 4.3

        Framework Enhancements

        iAd

        The ADInterstitialAdclass is controller that you can use to present full-screen banners in your content.You present these banners in an existing view or as part of a transition from one page of content to another.For example, you might use this object to incorporate full-page ads into a page-based magazine layout.

        For more information about the classes of the iAd framework, seeiAd Framework Reference.

        Media Player

        The Media Player framework includes the following enhancements:

        The MPMoviePlayerControllerclass supports playback of video content using AirPlay; see“AirPlayVideo Support”(page 62).

        The MPMovieAccessLog,MPMovieErrorLog,MPMovieAccessLogEvent, andMPMovieErrorLogEventclasses allow you to track network playback statistics.

        The MPMoviePlayerControllerclass now includes properties for accessing log information.
        For more information about the classes of the Media Player framework, see
        Media Player Framework Reference.

        UIKit

        The UIViewControllerclass added thedisablesAutomaticKeyboardDismissalmethod, which youcan use to override the default input view dismissal behavior.

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.64

        iOS 4.2

        This article summarizes the key developer-related features introduced in iOS 4.2. This version of the operatingsystem runs on all iOS-based devices. In addition to describing the key new features, this article lists thedocuments that describe those features in more detail.

        For the latest updates and information, you should also seeiOS 4.2 Release Notes. For the complete list of newAPIs added in iOS 4.2, seeiOS 4.2 API Diffs.

        Printing

        iOS now incorporates support for wireless printing from iPhone and iPad applications. For the most part, theobjects provided by UIKit do all of the heavy lifting associated with printing. They manage the printing interfaces,work with your application to render the printable content, and handle the scheduling and execution of printjobs on the printer.

        Print jobs submitted by your application are handed off to the printing system, which manages the actualprinting process. Print jobs from all applications on a device are queued and printed on a first-come, first-servedbasis. Users can get the status of print jobs from the Print Center application and can even use that applicationto cancel print jobs. All other aspects of printing are handled for you automatically by the system.

        Note:Wireless printing is available only on devices that support multitasking. You can use theUIPrintInteractionControllerobject to detect whether printing is available in your application.

        To simplify the printing process, UIKit provides automatic support for some types of content to make printingeasier. Specifically, applications provide printable content in one of three ways:

        An application can hand images or PDF content directly to UIKit and let it manage the printing of thoseitems.

        An application can use print formatter objects to lay out specific types of content over multiple pages.UIKit provides print formatters for plain text, HTML text, and some system views (web views, text views,and map views).

        An application can choose to render the content itself using a print page renderer object. This option givesyou the most control over your printed content but also lets you use print formatters to assist with thelayout of parts of your content.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.65

        iOS 4.2

        AirPlay

        For information about how to incorporate the new printing support into your applications, see “Printing” inDrawing and Printing Guide for iOS.

        AirPlay

        AirPlay is a technology that lets your application stream audio to Apple TV and to third-party AirPlay speakersand receivers. AirPlay support is built in to the AV Foundation framework and the Core Audio family offrameworks. Any audio content you play using these frameworks is automatically made eligible for AirPlaydistribution. Once the user chooses to play your audio using AirPlay, it is routed automatically by the system.

        For information on how to play audio content, seeMultimedia Programming Guide.

        Core MIDI

        The Core MIDI framework (CoreMIDI.framework) provides a standard way to communicate with MIDI devices,including hardware keyboards and synthesizers. You use this framework to send and receive MIDI messagesand to interact with MIDI peripherals connected to an iOS-based device using the dock connector or network.

        For more information about using this framework, seeCore MIDI Framework Reference.

        Weak Linking Support

        Applications that link against iOS SDK 4.2 or later can now take advantage of new support for determining theavailability of Objective-C classes. System frameworks now tag their classes with availability information thatthe compiler can use to link weakly to those classes as needed. This new tagging mechanism simplifies thecode you need to use to do runtime checking for the availability of the class. Whereas previously, you neededto use theNSClassFromStringfunction to determine whether a class was present, now you can simplycheck for the existence the class directly using code similar to the following:

          if ([UIPrintInteractionController class])
          {
        
             // Create an instance of the class and use it.
          }
        

        else{

             // The print interaction controller is not available.
        

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.66

        iOS 4.2

        Framework Enhancements

        }

        In order to use this feature, you must do the following:

        Build your project using LLVM and Clang. (The standalone GCC compiler does not currently support thisfeature.)

        Set your project’s deployment target to iOS 3.1 or later.

        Change the linking option for each framework you want to link weakly. To do this, open an inspector foryour application target and go to the inspector’s General tab to view the list of frameworks and librarieslinked against the target. For frameworks you want to link weakly, change the value in the Type columnfrom Required to Weak.

        If the deployment target for your application is set to a version of iOS that does not contain a givenframework (because it was introduced in a later version), set the link type of that framework to Weak. Formost other frameworks, you should leave the link type set to Required.

        For information about how to perform runtime availability checks for classes and methods, seeSDK CompatibilityGuide.

        Framework Enhancements

        The following sections highlight the significant changes to frameworks and technologies in iOS 4.2. For acomplete list of all new interfaces available in the system, seeiOS 4.2 API Diffs .

        Core Location

        The Core Location framework includes new interfaces for determining whether a device is authorized to uselocation services and for detecting changes in the current authorization status. For more information abouthow to use Core Location in your application, see Location and Maps Programming Guide.

        Game Kit

        The Game Kit framework includes a newGKFriendRequestComposeViewControllerclass, which you canpresent from your application and use to invite friends to play a game. For more information about how touse Game Kit in your application, seeGame Center Programming Guide.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.67

        iOS 4.2

        Framework Enhancements

        iAd

        The iAd framework now supports banner ads sized appropriately for iPad devices. For more information abouthow to incorporate ads into your applications, seeiAd Programming Guide.

        Media Player

        The Media Player framework includes the following enhancements:

        The interface presented by theMPVolumeViewclass now includes a control for routing audio content toAirPlay–enabled devices.

        The MPMediaItemandMPMediaItemCollectionclasses now descend from a common ancestor class:MPMediaEntity. This change in hierarchy allows you to create collections that include both items andother collections.

        Persistent IDs for more collection types are now available.
        Media queries now provide more information about how media items are grouped together.

        For more information about the classes of the Media Player framework, seeMedia Player Framework Reference.

        UIKit

        The UIKit framework includes the following enhancements

        New accessibility constants allow “scroll by page” capabilities using VoiceOver.
        New classes to support printing; see
        “Printing”(page 65)
        The
        UIDeviceclass now provides theplayInputClickmethod for playing the input-click sound directly.

        Application delegates can now use theapplication:openURL:sourceApplication:annotation:method to receive information about URLs that are opened while the application is running in thebackground.

        The UITextInputModeclass now exposes the language in use for inputting text.
        The
        UIDocumentInteractionControllerclass supports printing with the help of its delegate object.

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.68

        iOS 4.1

        This article summarizes the developer-related features introduced in iOS 4.1. This version of the operatingsystem runs on iPhone and iPod touch only and does not run on iPad. In addition to describing the new features,this article lists the documents that describe those features in more detail.

        Note:iOS4.1doesnotsupportiPad.ItrunsonlyoniPhoneandiPodtouchdevices.Youmustusea different version of the iOS SDK to develop iPad applications.

        For the latest updates and information, you should also seeiOS 4.1 Release Notes. For the list of API differencesbetween the iOS 4.1 and earlier versions of iOS, seeiOS 4.1 API Diffs.

        Game Center

        Game Center is an extension to the Game Kit framework that provides support for the following features:

        Aliases allow users to create their own online persona. Users log in to Game Center and interact with otherplayers anonymously through their alias. Players can set status messages as well as mark specific peopleas their friends.

        Leaderboards allow your application to post user scores to Game Center and retrieve them later. Youmight use this feature to show the best scores among all users of your application.

        Matchmaking allows you to create multiplayer games by connecting players who are logged into GameCenter. Players do not have to be local to each other to join a multiplayer game.

        Achievements allows you to record the progress a player has made in your game.
        The preceding features all contribute towards the experience users see in the Game Center application. For

        information about the classes of the Game Kit framework, seeGame Kit Framework Reference.

        Framework Enhancements

        The following existing frameworks and technologies include additional incremental changes. For a completelist of new interfaces, seeiOS 4.1 API Diffs .

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.69

        iOS 4.1

        Framework Enhancements

        AV Foundation

        The AV Foundation framework includes the following enhancements:

        A new AVQueuePlayerclass for playing a sequence ofAVPlayerItemobjects.
        A new
        AVAssetReaderclass for reading samples from media files.
        A new
        AVAssetWriterclass for writing samples to a data file and optionally compressing them.

        For more information about the classes of the AV Foundation framework, seeAV Foundation FrameworkReference.

        Assets Library

        The Assets Library framework includes new methods to save images to a user’s photo album. These newmethods are declared in theALAssetsLibraryclass.

        Core Text

        The Core Text framework includes new functions for managing fonts. For more information about the functionsavailable in the Core Text framework, seeCore Text Reference Collection.

        System Configuration

        The System Configuration framework contains new interfaces for identifying captive networks. For moreinformation about the functions available in the System Configuration framework, seeSystem ConfigurationFramework Reference.

        UIKit

        The UIKit framework includes the following enhancements:

        Additional constants for theUIImagePickerControllerclass that allow you to obtain additionalinformation about an image.

        A decimal keyboard type that you can use for text entry. You can specify this keyboard type using theUIKeyboardTypeDecimalPadconstant.

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

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.70

        iOS 4.0

        This article summarizes the developer-related features introduced in iOS 4. This version of the operating systemruns on iPhone and iPod touch only and does not run on iPad. In addition to describing the new features, thisarticle lists the documents that describe those features in more detail.

        Note:iOS4doesnotsupportiPad.ItrunsonlyoniPhoneandiPodtouchdevices.Youmustuseadifferent version of the iOS SDK to develop iPad applications.

        For the latest updates and information, you should also seeiOS 4.0 Release Notes. For the list of API differencesbetween the iOS 4 and earlier versions of iOS, seeiOS 4.0 API Diffs.

        Multitasking

        Applications built using iOS SDK 4 or later (and running in iOS 4 and later) are no longer terminated when theuser presses the Home button; instead, they now shift to a background execution context. For many applications,this means that the application enters a suspended state of execution shortly after entering the background.Keeping the application in memory avoids the subsequent launch cycle and allows an application to simplyreactivate itself, which improves the overall user experience. And suspending the application improves overallsystem performance by minimizing power usage and giving more execution time to the foreground application.

        Although most applications are suspended shortly after moving to the background, applications that need tocontinue working in the background may do so using one of the following techniques:

        An application can request a finite amount of time to complete some important task.

        An application can declare itself as supporting specific services that require regular background executiontime.

        An application can use local notifications to generate user alerts at designated times, whether or not theapplication is running.

        Regardless of whether your application is suspended or continues running in the background, supportingmultitasking does require some additional work on your part. Background applications can still be terminatedunder certain conditions (such as during low-memory conditions), and so applications must be ready to exit

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.71

        iOS 4.0

        Integration Technologies

        at any time. This means that many of the tasks you used to perform at quit time must now be performed whenyour application moves to the background. This requires implementing some new methods in your applicationdelegate to respond to application state transitions.

        For more information on how to handle the new background state transitions, and for information on how tocontinue running in the background, seeiOS App Programming Guide.

        Integration Technologies

        The following sections describe the technologies you can use to enhance your application’s user experience.

        Local Notifications

        Local notifications complement the existing push notifications by giving applications an avenue for generatingthe notifications locally instead of relying on an external server. Background applications can use localnotifications as a way to get a user’s attention when important events happen. For example, a navigationapplication running in the background can use local notifications to alert the user when it is time to make aturn. Applications can also schedule the delivery of local notifications for a future date and time and have thosenotifications delivered even if the application is not running.

        The advantage of local notifications is that they are independent of your application. Once a notification isscheduled, the system manages the delivery of it. Your application does not even have to be running whenthe notification is delivered.

        For more information about using local notifications, seeLocal and Push Notification Programming Guide.

        Event Kit

        The Event Kit framework (EventKit.framework) provides an interface for accessing calendar events on auser’s device. You can use this framework to get existing events and add new events to the user’s calendar.Calendar events can include alarms that you can configure with rules for when they should be delivered. Inaddition to using Event Kit for creating new events, you can use the view controllers of the Event Kit UIframework (EventKitUI.framework) to present standard system interfaces for viewing and editing events.

        For more information about the classes and methods of these frameworks, seeEvent Kit Framework ReferenceandEvent Kit UI Framework Reference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.72

        iOS 4.0

        Integration Technologies

        Core Motion

        The Core Motion framework (CoreMotion.framework) provides a single set of interfaces for accessing allmotion-based data available on a device. The framework supports accessing both raw and processedaccelerometer data using a new set of block-based interfaces. For devices with a built-in gyroscope, you canretrieve the raw gyro data as well as processed data reflecting the attitude and rotation rates of the device.You can use both the accelerometer and gyro-based data for games or other applications that use motion asinput or as a way to enhance the overall user experience.

        For more information about the classes and methods of this framework, see “Event Delivery: The ResponderChain” inEvent Handling Guide for iOS.

        Data Protection

        Applications that work with sensitive user data can now take advantage of the built-in encryption availableon some devices to protect that data. When your application designates a particular file as protected, thesystem stores that file on-disk in an encrypted format. While the device is locked, the contents of the file areinaccessible to both your application and to any potential intruders. However, when the device is unlockedby the user, a decryption key is created to allow your application to access the file.

        Implementing data protection requires you to be considerate in how you create and manage the data youwant to protect. Applications must themselves be designed to secure the data at creation time and to beprepared for changes in access to that data when the user locks and unlocks the device.

        For more information about how to add data protection to the files of your application, see “App States andMultitasking” iniOS App Programming Guide.

        Core Telephony

        The Core Telephony framework (CoreTelephony.framework) provides interfaces for interacting withphone-based information on devices that have a cellular radio. Applications can use this framework to getinformation about a user’s cellular service provider. Applications interested in cellular call events can also benotified when those events occur.

        For more information about using the classes and methods of this framework, seeCore Telephony FrameworkReference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.73

        iOS 4.0

        Graphics and Multimedia

        iAd

        You can use iAd (iAd.framework) to deliver banner-based advertisements from your application.Advertisements are incorporated into standard views that you integrate into your user interface and presentwhen you want. The views themselves work with Apple’s ad service to automatically handle all the workassociated with loading and presenting the ad content and responding to taps in those ads.

        For more information about using iAd in your applications, seeiAd Framework Reference.

        Graphics and Multimedia

        The following sections describe the new graphics and media-related technologies you can incorporate intoyour applications.

        High-Resolution Screen Support

        For the most part, applications running on devices with high-resolution screens should work with little or nomodifications. The coordinate values you specify during drawing or when manipulating views are all mappedto a logical coordinate system, which is decoupled from the underlying screen resolution. Any content youdraw is automatically scaled as needed to support high-resolution screens. For vector-based drawing code,the system frameworks automatically use any extra pixels to improve the crispness of your content. And if youuse images in your application, UIKit provides support for loading high-resolution variants of your existingimages automatically.

        For detailed information about how to support high-resolution screens, see “Supporting High-ResolutionScreens In Views” inDrawing and Printing Guide for iOS.

        Quick Look Framework

        The Quick Look framework (QuickLook.framework) provides a direct interface for previewing the contentsof files your application does not support directly. This framework is intended primarily for applications thatdownload files from the network or that otherwise work with files from unknown sources. After obtaining thefile, you use the view controller provided by this framework to display the contents of that file directly in youruser interface.

        For more information about the classes and methods of this framework, seeQuick Look Framework Referencefor iOS.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.74

        iOS 4.0

        Graphics and Multimedia

        AV Foundation

        The AV Foundation framework (AVFoundation.framework) is for applications that need to go beyond themusic and movie playback features found in the Media Player framework. Originally introduced in iOS 3.0, thisframework has been expanded in iOS 4 to include significant new capabilities, substantially broadening itsusage beyond basic audio playback and recording capabilities. Specifically, this framework now includes supportfor the following features:

        Media asset managementMedia editing
        Movie capture
        Movie playback

        Track management

        Metadata management for media items

        Stereophonic panning

        Precise synchronization between sounds

        An Objective-C interface for determining details about sound files, such as the data format, sample rate,and number of channels

        The AV Foundation framework is a single source for recording and playing back audio and video in iOS. Thisframework also provides much more sophisticated support for handling and managing media items.

        For more information about the classes and methods of the AV Foundation framework, seeAV FoundationFramework Reference.

        Assets Library

        The Assets Library framework (AssetsLibrary.framework) provides a query-based interface for retrievinga user’s photos and videos. Using this framework, you can access the same assets that are nominally managedby the Photos application, including items in the user’s saved photos album and any photos and videos thatwere imported onto the device. You can also save new photos and videos back to the user’s saved photosalbum.

        For more information about the classes and methods of this framework, seeAssets Library Framework Reference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.75

        iOS 4.0

        Core Services

        Image I/O

        The Image I/O framework (ImageIO.framework) provides interfaces for importing and exporting image dataand image metadata. This framework is built on top of the Core Graphics data types and functions and supportsall of the standard image types available in iOS.

        For more information about the functions and data types of this framework, seeImage I/O Reference Collection.

        Core Media

        The Core Media framework (CoreMedia.framework) provides the low-level media types used by AVFoundation. Most applications should never need to use this framework, but it is provided for those fewdevelopers who need more precise control over the creation and presentation of audio and video content.

        For more information about the functions and data types of this framework, seeCore Media FrameworkReference.

        Core Video

        The Core Video framework (CoreVideo.framework) provides buffer and buffer pool support for Core Media.Most applications should never need to use this framework directly.

        Core Services

        The following sections describe the new lower-level technologies and features you can incorporate into yourapplications.

        Block Objects

        Block objects are a C-level language construct that you can incorporate into your C and Objective-C code. Ablock object is essentially an anonymous function and the data that goes with that function, something whichin other languages is sometimes called a closureorlambda. Blocks are particularly useful as callbacks or inplaces where you need a way of easily combining both the code to be executed and the associated data.

        In iOS, blocks are commonly used in the following scenarios:

        As a replacement for delegates and delegate methods
        As a replacement for callback functions
        To implement completion handlers for one-time operationsTo facilitate performing a task on all the items in a collection

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.76

        iOS 4.0

        Xcode Tools

        Together with dispatch queues, to perform asynchronous tasks
        For an introduction to block objects and how you use them, see
        A Short Practical Guide to Blocks. For more

        information about blocks, seeBlocks Programming Topics.

        Grand Central Dispatch

        Grand Central Dispatch (GCD) is a BSD-level technology that you use to manage the execution of tasks in yourapplication. GCD combines an asynchronous programming model with a highly optimized core to provide aconvenient (and more efficient) alternative to threading. GCD also provides convenient alternatives for manytypes of low-level tasks, such as reading and writing file descriptors, implementing timers, monitoring signalsand process events, and more.

        For more information about how to use GCD in your applications, seeConcurrency Programming Guide. Forinformation about specific GCD functions, seeGrand Central Dispatch (GCD) Reference.

        Accelerate Framework

        The Accelerate framework (Accelerate.framework) contains interfaces for performing math, big-number,and DSP calculations, among others. The advantage of using this framework over writing your own versionsof these libraries is that it is optimized for the different hardware configurations present in iOS–based devices.Therefore, you can write your code once and be assured that it runs efficiently on all devices.

        For more information about the functions of the Accelerate framework, seeAccelerate Framework Reference.

        Xcode Tools

        The following sections describe the improvements to the Xcode tools and the support for developing iOSapplications.

        Xcode Improvements

        Xcode 3.2.3 introduces automatic device and provisioning-profile management in the Organizer window. Withautomatic device provisioning enabled, you can install applications on your device for debugging and testingwithout having to log in to your team portal to register the device and download a provisioning profile

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.77

        iOS 4.0

        Framework Enhancements

        Note:You still need to log in to your team portal to create provisioning profiles with specificapplication IDs for in-app purchase and push notifications. However, once created, those provisioningprofiles will also be managed by Xcode if automatic device provisioning is enabled.

        For more information about using Xcode, seeXcode Overview.

        UI Automation API

        The Instruments application now provides support for automating the testing of your iOS applications. Thebuilt-in Automation instrument works from scripts (written in JavaScript) that you provide to drive the simulationof events in your application. These synthetic events are generated with the help of the accessibility interfacesbuilt into iOS and integrated into all existing UIKit views. You can use this instrument to improve your testingprocess and deliver more robust applications.

        For information about how to use the Automation instrument, seeInstruments User Guide. For informationabout the JavaScript objects and commands you use in your scripts, seeUI Automation JavaScript Reference.

        Framework Enhancements

        The following existing frameworks and technologies include additional incremental changes. For a completelist of new interfaces, seeiOS 4.0 API Diffs .

        UIKit Framework Enhancements

        The UIKit framework includes the following enhancements:

        The UIApplicationclass andUIApplicationDelegateprotocol include new methods for schedulinglocal notifications and for supporting multitasking.

        Drawing to a graphics context in UIKit is now thread-safe. Specifically:

        The routines used to access and manipulate the graphics context can now correctly handle contextsresiding on different threads.

        String and image drawing is now thread-safe.

        Using color and font objects in multiple threads is now safe to do.


        The UIImagePickerControllerclass includes methods for programmatically starting and stoppingvideo capture. It also includes options for selecting which camera you want to use on a device and forenabling a built-in flash.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.78

        iOS 4.0

        Framework Enhancements

        The UILocalNotificationclass supports the configuration of local notifications; see“LocalNotifications”(page 72).

        The UIViewclass includes new block-based methods for implementing animations.
        The
        UIWindowclass has a newrootViewControllerproperty that you can use to change the contents

        of the window.

        Media applications can now receive events related to the controls on an attached set of headphones. Youcan use these events to control the playback of media-related items.

        Several new accessibility interfaces help you make some UI elements more accessible and allow you tocustomize your application experience specifically for VoiceOver users:

        The UIAccessibilityActionprotocol makes it easy for VoiceOver users to adjust the value of UIelements, such as pickers and sliders.

        UIPickerViewAccessibilityDelegateprotocol enables access to the individual componentsof a picker.

        UIAccessibilityFocusprotocol allows you to find out when VoiceOver is focused on an element,so you can help users avoid making unnecessary taps.

        The UIAccessibilityTraitStartsMediaSessiontrait allows you to prevent VoiceOver fromspeaking during a media session that should not be interrupted.

        New interfaces in UIAccessibilityprotocol allow you to specify the language in which labels andhints are spoken, and provide announcements that describe events that don't update application UIin way that would be perceptible to VoiceOver users.

        The UINibclass provides a way to instantiate multiple sets of objects efficiently from the same nib file.For information about the classes of the UIKit framework, seeUIKit Framework Reference.

        Foundation Framework Enhancements

        The Foundation framework includes the following enhancements:

        Most delegate methods are now declared in formal protocols instead of as categories onNSObject.Block-based variants are now available for many types of operations.
        There is new support for creating and formatting date information in
        NSDateandNSDateFormatter.TheNSDateComponentsclass added support for specifying time zone and quarter information.

        There is support for regular-expression matching using theNSRegularExpression,NSDataDetector,andNSTextCheckingResultclasses.

        The NSBlockOperationclass allows you to add blocks to operation queues.
        You can use the
        NSFileManagerclass to mark files as protected; see“Data Protection”(page 73).

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.79

        iOS 4.0

        Framework Enhancements

        The NSFileWrapperclass allows you to work with package-based document types.

        The NSOrthographyclass describes the linguistic content of a piece of text.

        The NSCacheclass provides support for storing and managing temporary data.

        The URL-related classes have been updated so that you can now pipeline URL requests and set requestpriorities.

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

        OpenGL ES Enhancements

        The OpenGL ES framework includes the following enhancements:

        The APPLE_framebuffer_multisampleextension enables full-scene anti-aliasing.
        The
        EXT_framebuffer_discardextension can be used to improve the performance of applications

        that use depth buffers or multisample framebuffers.

        The APPLE_texture_max_levelandEXT_shader_texture_lodextensions provide more controlover texture sampling.

        The OES_vertex_array_object(http://www.khronos.org/registry/gles/extensions/OES/OES_vertex_ar-ray_object.txt) API allows caching of vertex array state, to decrease driver overhead.

        The OES_depth_textureextension enables rendering real-time shadows using shadow maps.

        The OES_texture_float(http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt)andOES_texture_half_float(http://www.khronos.org/registry/gles/extensions/OES/OES_tex-ture_float.txt) extensions adds texture formats with floating point components to enable High DynamicRange rendering.

        The APPLE_rgb_422(http://www.opengl.org/registry/specs/APPLE/rgb_422.txt) extension enablestexturing from some common video formats.

        Performance of texture creation and modification has been significantly improved.Driver performance has been generally improved.

        Game Kit Enhancements

        The Game Kit framework includes a beta implementation of a centralized service called Game Center. Thisservice provides game developers with a standard way to implement the following features:

        Aliases allow users to create their own online persona. Users log in to Game Center and interact with otherplayers anonymously through their alias. Players can set status messages as well as mark specific peopleas their friends.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.80

        iOS 4.0

        Framework Enhancements

        Leader boards allow your application to post scores to Game Center and retrieve them later.Matchmaking allows players to connect with other players with Game Center accounts.

        For information about the classes of the Game Kit framework, seeGame Kit Framework Reference.

        Core Location Enhancements

        The Core Location framework now supports the following features:

        A location monitoring service that tracks significant changes using only cellular information. This solutionoffers a lower-power alternative for determining the user’s location.

        The ability to define arbitrary regions and detect boundary crossings into or out of those regions. Thisfeature can be used for proximity detection regardless of whether the application is running.

        For information about the classes of the Core Location framework, seeCore Location Framework Reference.

        Map Kit Enhancements

        The Map Kit framework includes the following enhancements:

        Support for draggable map annotationsSupport for map overlays

        Draggable map annotations make it much easier to reposition those annotations after they have been addedto a map. The Map Kit framework handles most of the touch events associated with initiating, tracking, andending a drag operation. However, the annotation view must work in conjunction with the map view delegateto ensure that dragging of the annotation view is supported.

        Map overlays provide a way to create more complex types of annotations. Instead of being pinned to a singlepoint, an overlay can represent a path or shape that spans a wider region. You can use overlays to layerinformation such as bus routes, election maps, park boundaries, and weather maps on top of the map.

        For information about the functions and types of the Map Kit framework, seeMap Kit Framework Reference.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.81

        Important:GameCenterisavailabletodevelopersonlyiniOS4.Itisintroducedasadeveloper-onlyfeatureso that you can provide feedback as you implement and test Game Center features in your applications.However, Game Center is not a user feature in iOS 4 and you should not deploy applications that use it tothe App Store.

        iOS 4.0

        Inherited Improvements

        Message UI Enhancements

        The Message UI framework includes a newMFMessageComposeViewControllerclass for composing SMSmessages. This class manages a standard system interface for composing and sending SMS messages. Incontrast with sending SMS messages using a specially formatted URL, this class allows you to create and sendthe message entirely from within your application.

        For more information about the classes of the Message UI framework, seeMessage UI Framework Reference.

        Core Graphics Enhancements

        The Core Graphics framework includes the following enhancements:

        The ability to embed metadata into PDF files using theCGPDFContextAddDocumentMetadatafunctionSupport for creating color spaces using an ICC profile
        Graphics context support for font smoothing and fine-grained pixel manipulation

        For information about the functions and types of the Core Graphics framework, seeCore Graphics FrameworkReference.

        ICU Enhancements

        The International Components for Unicode (ICU) libraries were updated to version 4.4. ICU is an open-sourceproject for Unicode support and software internationalization. The installed version of ICU includes only asubset of the header files that are part of the broader ICU library. Specifically, iOS includes only the headersused to support regular expressions.

        For more information about using the functions of the ICU 4.4 library, see the documentation athttp://site.icu-project.org/.

        Inherited Improvements

        Although iOS 3.2 does not run on iPhone and iPod touch devices, many of the features introduced in thatversion of the operating system are also supported in iOS 4. Specifically, iOS 4 supports:

        Custom input viewsConnecting external displaysFile-sharing support
        Gesture recognizers

        2013-10-22

        | Copyright © 2013 Apple Inc. All Rights Reserved.82

        iOS 4.0

        Inherited Improvements

        Core Text for text layout and rendering
        Text input through integration with the keyboardCustom fonts
        ICU Regular Expressions
        Document types
        PDF generation
        Xcode Tools changes
        UIKit framework changes
        Media Player framework changes
        Core Animation changes
        Foundation framework changes

        2013-10-22

        | Copyright © 2013 Apple Inc. All Rights Reserved.83

        Document Revision History

        This table describes the changes toWhat's New in iOS.

        Date

        Notes

        2013-10-222013-09-182013-01-282012-09-25

        2012-09-19

        2012-03-072011-10-122011-02-282010-11-152010-08-172010-07-082010-06-042010-03-24

        Updated the web links for OpenGL ES extensions added in iOS 7.

        Added information about new features in iOS 7.

        Added new features introduced in iOS 6.1.

        The links to the OpenGL ES extensions added in iOS 6 now point to thefinal versions posted on the Khronos website.

        Updated to include features introduced in iOS 6.Removed older articles containing changes in iOS 3.x.

        Updated to include features introduced in iOS 5.1.Updated to include features introduced in iOS 5.0.Added features introduced in iOS 4.3.
        Added features introduced in iOS 4.2.

        Added features introduced in iOS 4.1.

        Changed the title from "What's New in iPhone OS."

        Added information about new features in iOS 4.0.

        Moved the iOS 3.1 information to its own article and added a new articlecovering features in iOS 3.2.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.84

        Document Revision History

        Date

        Notes

        2009-08-27

        2009-06-16

        Updated the iOS 3.0 article to reflect features introduced in all 3.x versionsof iOS.

        Added new features related to the introduction of new iPhone hardware.

        2013-10-22 | Copyright © 2013 Apple Inc. All Rights Reserved.85

        Apple Inc.
        Copyright © 2013 Apple Inc.All rights reserved.

        No part of this publication may be reproduced,stored in a retrieval system, or transmitted, in anyform or by any means, mechanical, electronic,photocopying, recording, or otherwise, withoutprior written permission of Apple Inc., with thefollowing exceptions: Any person is herebyauthorized to store documentation on a singlecomputer for personal use only and to printcopies of documentation for personal useprovided that the documentation containsApple’s copyright notice.

        No licenses, express or implied, are granted withrespect to any of the technology described in thisdocument. Apple retains all intellectual propertyrights associated with the technology describedin this document. This document is intended toassist application developers to developapplications only for Apple-labeled computers.

        Apple Inc.
        1 Infinite LoopCupertino, CA 95014408-996-1010

        Apple, the Apple logo, AirPlay, Apple TV, Cocoa,Cocoa Touch, iCal, Instruments, iPad, iPhone, iPod,iPod touch, iTunes, Keychain, Mac, Mac OS,Objective-C, OS X, Passbook, QuickTime, Safari,and Xcode are trademarks of Apple Inc.,registered in the U.S. and other countries.

        AirDrop is a trademark of Apple Inc.

        iAd and iCloud are service marks of Apple Inc.,registered in the U.S. and other countries.

        App Store is a service mark of Apple Inc.

        Java is a registered trademark of Oracle and/orits affiliates.

        OpenGL is a registered trademark of SiliconGraphics, Inc.

        UNIX is a registered trademark of The OpenGroup.

        iOS is a trademark or registered trademark ofCisco in the U.S. and other countries and is usedunder license.

        Even though Apple has reviewed this document,APPLE MAKES NO WARRANTY OR REPRESENTATION,EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THISDOCUMENT, ITS QUALITY, ACCURACY,MERCHANTABILITY, OR FITNESS FOR A PARTICULARPURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED“AS IS,” AND YOU, THE READER, ARE ASSUMING THEENTIRE RISK AS TO ITS QUALITY AND ACCURACY.

        IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIALDAMAGES RESULTING FROM ANY DEFECT ORINACCURACY IN THIS DOCUMENT, even if advised ofthe possibility of such damages.

        THE WARRANTY AND REMEDIES SET FORTH ABOVEARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORALOR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer,agent, or employee is authorized to make anymodification, extension, or addition to this warranty.

        Some states do not allow the exclusion or limitationof implied warranties or liability for incidental orconsequential damages, so the above limitation orexclusion may not apply to you. This warranty givesyou specific legal rights, and you may also have otherrights which vary from state to state. 

        展开全文
      • The Cook and the Chef: Musk’s Secret Sauce

        千次阅读 2016-04-14 13:24:41
        source: http://waitbutwhy.com/2015/11/the-cook-and-the-chef-musks-secret-sauce.html ...The Cook and the Chef: Musk’s Secret Sauce Welcome to the last post in the series on the world of Elon
      • 使用MyBatis查询数据时候遇到这个异常,stackoverflow上一条回答解决办法是通过给jdbc链接增加...实际的错误还应该有:java.sql.SQLException: Value ‘0000-00-00’ can not be represented as java.sql.Date j...
      • 16.Evaluate the following query: SQL> SELECT promo_name||q'{'s start date was }'||promo_begin_date AS "Promotion Launches" FROM promotions;
      • shell date time命令时间处理

        千次阅读 2018-08-02 08:54:50
        date 获取当前时间 # 计算间隔时间 time1=$(date +%s) sleep 10 echo 序列优化 `date` `expr $(date +%s) / 60 - $time1 / 60`min &amp;amp;gt;&amp;amp;gt; times.txt time1=$(date +%s)
      • date-fns日期格式化 总览 (Overview) Ever written a method to get the time of day in GMT? or have wondered if I need to convert the time to UTC? Most applications have some common date-time ...
      • 转载自:... Whats the difference between Taxonomies and Ontologies? - Ask Dr. Search Last Updated Jun 2009 A Reader Asks: Whats the diff
      • 将java.util.Date转换为java.time.LocalDate

        千次阅读 2020-05-05 11:20:28
        What is the best way to convert a java.util.Date object to the new JDK 8/JSR-310 java.time.LocalDat
      • shell date 命令

        2018-09-19 23:57:14
        DATE=`date +%Y%m%d` +号后面是定义格式为年月日 显示前一天为 DATE1=`date -d '1 days ago' +%Y%m%d` 加-d参数可以设置与当前日期的计算时间,同样,前2天为'2 days ago',去掉ago则为当前日期之后多少天   ...
      • What day is it

        2017-05-23 06:32:25
        Problem Description Today is Saturday, 17th Nov,2007....if the date is illegal, you should output "illegal". Or, you should output what day it is. Sample Input 2007 11 17 Sample Output Saturday
      • 存储时间的几种方式 一般情况下:数据库可以这样存储时间: bigint(存毫秒数Long) 存储时间戳,然后new Date(long date)转化为时间 DateTime TimeStamp时间戳 ...The DATE type is used for values with ...
      • linux date 前一天等多种用法

        万次阅读 2016-10-27 20:35:43
        source: ... BASH SHELL中可以定义变量显示当前日期 ...DATE=`date +%Y%m%d` +号后面是定义格式为年月日 ...DATE1=`date -d '1 days ago' +%Y%m%d` 加-d参数可以设置与当前日期
      • Java 8 has a completely new API for date and time. Java 8具有用于日期和时间的全新API。 One of the most useful cl
      • This section describes what a software engineer's resume should look like and what you should be doing well before your interview. Behavioral Preparation Although most of a software engineering ...
      • let s = Date . now ( ) // the number is miniseconds // something run let e = Date . now ( ) console . log ( whatTime ( ( s - e ) / 1000 ) // whatTime is seconds , pleace /1000 用法 const whatTime = ...
      • 一、原因 使用Mybatis查询一条数据时 返回 异常如下: org.springframework.dao.TransientDataAccessResourceException: Error attempting to get column 'update_... Cause: java.sql.SQLException: Zero date valu...
      • K8s安全总结

        千次阅读 2017-12-05 11:21:42
        对kubernetes api的访问方有三种:k8s集群的组件、普通用户、k8s集群中运行的应用。 Kubernetes根据使用账号的进程是否在Pod内部运行这个标准将账号划分为用于提供给外部进程使用的用户账号(User Accounts)和...
      • Whats New in the Fourth Edition? The fourth edition covers Hadoop 2 exclusively. The Hadoop 2 release series is the current active release series and contains the most stable versions of Hadoop. ...
      • Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org ...
      • From article:http://www.youdzone.com/signature.html 有个家伙已经将此文章翻译,如果要看可以点here What is a Digital Signature?...An introduction to Digital Signatures, by David Youd ...(Bob's
      • What is this?

        千次阅读 2014-03-07 10:34:30
        (This is an article I wrote several years ago to explain the this keyword in some programming languages. The title is a pun intended.)Java, C# etc.The this is a keyword in programming languages such a
      • 最近利用空闲时间,把之前部署和学习k8s时的整个过程和遇到的问题总结了一下,分享给有需要的小伙伴。对自己也是一种知识的加固 针对于K8S的安装有很多种方法,像二进制啊等,这里介绍的是kubeadm方法,在线拉取...
      • 带有示例的Python date weekday()方法

        千次阅读 2020-07-20 22:23:53
        Python date.weekday()方法 (Python date.weekday() Method) date.weekday() method is used to manipulate objects of date class of module datetime. date.weekday()方法用于操作模块日期时间的日期类的对象。 ...

      空空如也

      空空如也

      1 2 3 4 5 ... 20
      收藏数 73,055
      精华内容 29,222
      关键字:

      datethewhat's