12-AddressBook

12-AddressBook - CS193P - Lecture 12 iPhone Application...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
CS193P - Lecture 12 iPhone Application Development Address Book - Putting People in Your App
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements Presence 3 due tomorrow at 11:59PM Presence 4 (last assignment!) due next Tuesday
Background image of page 2
Final Project Proposals Due tonight! ! Handout on website has all the info If you still need an idea for a project, let us know We will be responding with feedback & a thumbs-up
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Today’s Guest Speaker Alex Aybes ! iPhone Software Engineer from Apple
Background image of page 4
Address Book APIs CoreFoundation Merging from an external source of people Using contacts in your application Today’s Topics
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Putting Contacts in Your App The Hello World of Address Book
Background image of page 6
The Hello World of Address Book Create a person and set some properties Create ABPersonViewController Push the view controller onto the navigation stack
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Demo: The Hello World of Address Book
Background image of page 8
CoreFoundation
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CoreFoundation vs. Foundation CoreFoundation is a framework written in C Many parallels to Foundation ! CFDictionaryRef, CFStringRef ! CFRetain, CFRelease AddressBook framework is also C-based ! Uses CoreFoundation data types and semantics Addition to memory management naming conventions ! Functions with Create in their title return a retained object ! For example, ABAddressBookCreate( );
Background image of page 10
Toll-Free Bridging Supported for many types of objects ! Strings, arrays, dictionaries, dates, numbers, data streams, more Very convenient for C with Objective-C CFArrayRef array = ABAddressBookCopyPeopleWithName(. ..); NSLog(@“%d”, [(NSArray *)array count]); NSMutableArray *mutableArray = [(NSArray *)array mutableCopy]; [mutableArray release]; if (array) { CFRelease(array); }
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CoreFoundation and NULL Unlike Objective-C, must NULL-check CF type objects ! (Since nil is typed id, we use NULL for CF)
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2009 for the course CS 193D taught by Professor Staff during the Spring '08 term at Stanford.

Page1 / 50

12-AddressBook - CS193P - Lecture 12 iPhone Application...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online