<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Techelp &#187; iPhone SDK</title>
	<atom:link href="http://techelp.in/thome/category/iphone-sdk/feed/" rel="self" type="application/rss+xml" />
	<link>http://techelp.in/thome</link>
	<description></description>
	<lastBuildDate>Fri, 24 Feb 2012 06:21:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Add contact to Address Book using iPhone SDK</title>
		<link>http://techelp.in/thome/2009/10/06/add-contact-to-address-book-using-iphone-sdk/</link>
		<comments>http://techelp.in/thome/2009/10/06/add-contact-to-address-book-using-iphone-sdk/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 23:43:57 +0000</pubDate>
		<dc:creator>Sudha C Reddi</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[Address Book API]]></category>

		<guid isPermaLink="false">http://techelp.in/mobile/?p=4</guid>
		<description><![CDATA[Below is the code for adding a contact to iPhone’s Address Book using iPhone SDK. What do you think of this post?Awesome&#160;(7) Interesting&#160;(1) Useful&#160;(2) Boring&#160;(0) Sucks&#160;(1)]]></description>
			<content:encoded><![CDATA[<p><br/><br />
Below is the code for adding a contact to iPhone’s Address Book using iPhone SDK.<br />
<br/></p>
<pre class="brush: objc; title: ; notranslate">
ABAddressBookRef addressBook = ABAddressBookCreate();
ABRecordRef person = ABPersonCreate();

ABRecordSetValue(person, kABPersonFirstNameProperty, @&quot;Sudha&quot; , nil);
ABRecordSetValue(person, kABPersonLastNameProperty, @&quot;Reddy&quot;, nil);

ABMutableMultiValueRef phoneNumberMultiValue = ABMultiValueCreateMutable(kABPersonPhoneProperty);
ABMultiValueAddValueAndLabel(phoneNumberMultiValue, @&quot;1234567890&quot;, kABHomeLabel, nil);
ABMultiValueAddValueAndLabel(phoneNumberMultiValue, @&quot;9876543210&quot;, kABPersonPhoneMobileLabel, nil);
ABMultiValueAddValueAndLabel(phoneNumberMultiValue, @&quot;04022222222&quot;, kABWorkLabel, nil);
ABRecordSetValue(person, kABPersonPhoneProperty, phoneNumberMultiValue, nil);

ABMutableMultiValueRef emailMultiValue = ABMultiValueCreateMutable(kABPersonEmailProperty);
ABMultiValueAddValueAndLabel(emailMultiValue, @&quot;whatever@gmail.com&quot;, kABWorkLabel, nil);
ABRecordSetValue(person, kABPersonEmailProperty, emailMultiValue, nil);

NSDictionary *dictionary = [[NSDictionary alloc] initWithObjects: [NSArray arrayWithObjects:@&quot;1234 Whatever Street&quot;, @&quot;Hyderabad&quot;, @&quot;AP&quot;, @&quot;INDIA&quot;, @&quot;500008&quot;, nil] forKeys: [NSArray arrayWithObjects: (NSString *)kABPersonAddressStreetKey, (NSString *)kABPersonAddressCityKey, (NSString *)kABPersonAddressStateKey, (NSString *)kABPersonAddressCountryKey, (NSString *)kABPersonAddressZIPKey, nil]];
ABMultiValueRef addressMultiValue = ABMultiValueCreateMutable(kABDictionaryPropertyType);
ABMultiValueAddValueAndLabel(addressMultiValue, (CFDictionaryRef *)dictionary, kABWorkLabel, nil);
ABRecordSetValue(person, kABPersonAddressProperty, addressMultiValue, nil); ABRecordCopyValue(person, kABPersonAddressProperty);

ABAddressBookAddRecord(addressBook, person, nil);
ABAddressBookSave(addressBook, nil);

CFRelease(person);
CFRelease(addressMultiValue);
CFRelease(phoneNumberMultiValue);
CFRelease(emailMultiValue);
[dictionary release];
</pre>

<div id='reaction_buttons_post170' class='reaction_buttons'>
<div class="reaction_buttons_tagline">What do you think of this post?</div><a class='reaction_button reaction_button_Awesome_count' href="javascript:reaction_buttons_increment_button_ajax('170', 'Awesome');">Awesome&nbsp;<span class='count' style='display: none;'>(<span class='count_number'>7</span>)</span></a> <a class='reaction_button reaction_button_Interesting_count' href="javascript:reaction_buttons_increment_button_ajax('170', 'Interesting');">Interesting&nbsp;<span class='count' style='display: none;'>(<span class='count_number'>1</span>)</span></a> <a class='reaction_button reaction_button_Useful_count' href="javascript:reaction_buttons_increment_button_ajax('170', 'Useful');">Useful&nbsp;<span class='count' style='display: none;'>(<span class='count_number'>2</span>)</span></a> <a class='reaction_button reaction_button_Boring_count' href="javascript:reaction_buttons_increment_button_ajax('170', 'Boring');">Boring&nbsp;<span class='count' style='display: none;'>(<span class='count_number'>0</span>)</span></a> <a class='reaction_button reaction_button_Sucks_count' href="javascript:reaction_buttons_increment_button_ajax('170', 'Sucks');">Sucks&nbsp;<span class='count' style='display: none;'>(<span class='count_number'>1</span>)</span></a> </div>
]]></content:encoded>
			<wfw:commentRss>http://techelp.in/thome/2009/10/06/add-contact-to-address-book-using-iphone-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

