<?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>Association Thoughts &#187; Uncategorized</title>
	<atom:link href="http://associationthoughts.com/blog/archives/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://associationthoughts.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 19 Sep 2011 16:55:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>QR code</title>
		<link>http://associationthoughts.com/blog/archives/200</link>
		<comments>http://associationthoughts.com/blog/archives/200#comments</comments>
		<pubDate>Thu, 07 Apr 2011 18:09:08 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/?p=200</guid>
		<description><![CDATA[Generated at http://goqr.me/]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.qrserver.com/v1/create-qr-code/?data=BEGIN%3AVCARD%0AFN%3AGrant%20McInnes%0ATEL%3A5123701475%0AEMAIL%3Agrant.mcinnes%40texmed.org%0AURL%3Ahttp%3A%2F%2Fwww.texmed.org%0AN%3AMcInnes%3BGrant%0AADR%3A401%20W%2015th%20St%3B78701%3BAustin%0AORG%3ATexas%20Medical%20Association%0AROLE%3ADirector%20of%20BI%20and%20Software%20Development%0AVERSION%3A3.0%0AEND%3AVCARD%0A&#38;size=250x250" alt="QR Code" title="" /></p>
<p>Generated at <a href="http://goqr.me/">http://goqr.me/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/200/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a Contact to the iPhone Address Book</title>
		<link>http://associationthoughts.com/blog/archives/101</link>
		<comments>http://associationthoughts.com/blog/archives/101#comments</comments>
		<pubDate>Mon, 26 Oct 2009 21:37:17 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/101</guid>
		<description><![CDATA[http://www.modelmetrics.com/tomgersic/iphone-programming-adding-a-contact-to-the-iphone-address-book/ We then create our reference to the iPhone Address Book with a call to ABAddressBookCreate(): &#160;&#160;&#160; &#160;&#160;&#160; ABAddressBookRef iPhoneAddressBook = ABAddressBookCreate(); And then we create a new person record: &#160;&#160;&#160; &#160;&#160;&#160; ABRecordRef newPerson = ABPersonCreate();&#160; At this point, we haven’t saved anything to the address book yet, but we can start adding data to [...]]]></description>
			<content:encoded><![CDATA[<p>http://www.modelmetrics.com/tomgersic/iphone-programming-adding-a-contact-to-the-iphone-address-book/</p>
<p>We then create our reference to the iPhone Address Book with a call to ABAddressBookCreate():</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABAddressBookRef iPhoneAddressBook = ABAddressBookCreate();</span></p>
<p>And then we create a new person record:</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordRef newPerson = ABPersonCreate();</span><br />&nbsp;</p>
<p>At this point, we haven’t saved anything to the address book yet, but we can start adding data to the person record. To do this, we use ABRecordSetValue, but some fields need to be formatted differently from others. For some, like first name and last name, we can just pass in a string:</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordSetValue(newPerson, kABPersonFirstNameProperty, @&#8221;John&#8221;, &amp;error);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordSetValue(newPerson, kABPersonLastNameProperty, @&#8221;Doe&#8221;, &amp;error);</span></p>
<p>kABPersonFirstNameProperty and <span style="color: rgb(153, 51, 0);">kABPersonLastNameProperty</span> are constants defined by Apple that specify which fields you’re saving. They’re listed in the XCode documentation under Personal Information Properties in the ABPerson&nbsp;Reference document. We can also set some other fields in this manner, such as company and title:</p>
<p> <span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordSetValue(newPerson, kABPersonOrganizationProperty, @&#8221;Model Metrics&#8221;, &amp;error);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordSetValue(newPerson, kABPersonJobTitleProperty, @&#8221;Senior Slacker&#8221;, &amp;error);</span></p>
<p>Where it gets a bit trickier is when we want to set our phone, email, or address properties, because these fields use <span style="color: rgb(153, 51, 0);">ABMutableMultiValueRef</span> rather than strings to store the data, and the specific data types of the values vary a bit depending on which one we’re talking about. For phone, we would do something like this:</p>
<p>&nbsp;<br /><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ABMutableMultiValueRef multiPhone = ABMultiValueCreateMutable(kABMultiStringPropertyType);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ABMultiValueAddValueAndLabel(multiPhone, @&#8221;1-555-555-5555&#8243;, kABPersonPhoneMainLabel, NULL);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ABMultiValueAddValueAndLabel(multiPhone, @&#8221;1-123-456-7890&#8243;, kABPersonPhoneMobileLabel, NULL);&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ABMultiValueAddValueAndLabel(multiPhone, @&#8221;1-987-654-3210&#8243;, kABOtherLabel, NULL);&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ABRecordSetValue(newPerson, kABPersonPhoneProperty, multiPhone,nil);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CFRelease(multiPhone);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p>&nbsp;The first two phone types (<span style="color: rgb(153, 51, 0);">kABPersonPhoneMainLabel</span> and <span style="color: rgb(153, 51, 0);">kABPersonPhoneMobileLabel</span>) are listed as Phone Number Properties in the ABPerson Reference, along with <span style="color: rgb(153, 51, 0);">kABPersonPhoneHomeFAXLabel</span>, <span style="color: rgb(153, 51, 0);">kABPersonPhoneWorkFAXLabel</span>, and <span style="color: rgb(153, 51, 0);">kABPersonPhonePagerLabel</span>. Despite the fact that the two fax numbers and the pager number seem fairly useless (you can’t send a fax from your phone, and who has a pager anymore?) but there’s nothing listed there for Other, or Work Phone or anything like that. That’s where the Generic Property labels come into play:</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp; &nbsp; &nbsp; kABWorkLabel;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kABHomeLabel;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kABOtherLabel;</span></p>
<p>Those will file the phone numbers as Work, Home, and Other, respectively. After adding the values to the <span style="color: rgb(153, 51, 0);">ABMutableMultiValueRef</span>, we need to call <span style="color: rgb(153, 51, 0);">ABRecordSetValue</span>, only this time instead of passing a string in for the third parameter, we pass in multiPhone. Then be sure to free up the memory with CFRelease.</p>
<p>Adding email addresses to the record is pretty similar to adding phone numbers, where we create an <span style="color: rgb(153, 51, 0);">ABMutableMultiValueRef</span> of strings:</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABMutableMultiValueRef multiEmail = ABMultiValueCreateMutable(kABMultiStringPropertyType);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABMultiValueAddValueAndLabel(multiEmail, @&#8221;johndoe@modelmetrics.com&#8221;, kABWorkLabel, NULL);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordSetValue(newPerson, kABPersonEmailProperty, multiEmail, &amp;error);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CFRelease(multiEmail);</span></p>
<p>Where it gets a little different is when we go to set the street address values. While we do still use an <span style="color: rgb(153, 51, 0);">ABMutableMultiValueRef</span>, we won’t be using <span style="color: rgb(153, 51, 0);">kABMultiStringPropertyType</span>. To set the street address, we use <span style="color: rgb(153, 51, 0);">kABMultiDictionaryPropertyType</span> instead, so we have to create an <span style="color: rgb(153, 51, 0);">NSMutableDictionary</span>, and the method calls end up being a bit different:</p>
<p>&nbsp;&nbsp;&nbsp;<span style="color: rgb(153, 51, 0);"> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABMutableMultiValueRef multiAddress = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NSMutableDictionary *addressDictionary = [[NSMutableDictionary alloc] init];</span></p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(153, 51, 0);">[addressDictionary setObject:@"750 North Orleans Street, Ste 601" forKey:(NSString *) kABPersonAddressStreetKey];<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [addressDictionary setObject:@"Chicago" forKey:(NSString *)kABPersonAddressCityKey];<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [addressDictionary setObject:@"IL" forKey:(NSString *)kABPersonAddressStateKey];<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [addressDictionary setObject:@"60654" forKey:(NSString *)kABPersonAddressZIPKey];</span></p>
<p>&nbsp;&nbsp;<span style="color: rgb(153, 51, 0);">&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABMultiValueAddValueAndLabel(multiAddress, addressDictionary, kABWorkLabel, NULL);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABRecordSetValue(newPerson, kABPersonAddressProperty, multiAddress,&amp;error);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CFRelease(multiAddress);</span></p>
<p>kABWorkLabel means that we’re setting this as the contact’s work address. And to add it to the contact record, we call <span style="color: rgb(153, 51, 0);">ABRecordSetValue</span> as before, releasing the memory afterward.</p>
<p>&nbsp;The last step is to add the new record to the address book, and save it back to the device:</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABAddressBookAddRecord(iPhoneAddressBook, newPerson, &amp;error);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ABAddressBookSave(iPhoneAddressBook, &amp;error);</span></p>
<p>And then we can check for any errors:</p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (error != NULL) <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</span></p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSLog(@&#8221;Danger Will Robinson!&nbsp;Danger!&#8221;);</span></p>
<p><span style="color: rgb(153, 51, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p>
<blockquote></blockquote>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=6f7db767-c8c1-8691-8ca6-8a89c0467a49" /></div>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/101/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Survey Results: Which Smartphone Will Own the Healthcare Market?</title>
		<link>http://associationthoughts.com/blog/archives/95</link>
		<comments>http://associationthoughts.com/blog/archives/95#comments</comments>
		<pubDate>Fri, 21 Aug 2009 22:59:02 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/95</guid>
		<description><![CDATA[Survey Results: Which Smartphone Will Own the Healthcare Market? Posted using ShareThis]]></description>
			<content:encoded><![CDATA[<p><a href=http://shar.es/B2fA>Survey Results: Which Smartphone Will Own the Healthcare Market?</a></p>
<p>Posted using <a href="http://sharethis.com">ShareThis</a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/95/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foo</title>
		<link>http://associationthoughts.com/blog/archives/93</link>
		<comments>http://associationthoughts.com/blog/archives/93#comments</comments>
		<pubDate>Fri, 07 Aug 2009 16:55:09 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/93</guid>
		<description><![CDATA[foo bar]]></description>
			<content:encoded><![CDATA[<p>foo bar</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=3e4d3bb1-0d08-81ec-b82c-7412ae5d2f67" /></div>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/93/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Use Examples</title>
		<link>http://associationthoughts.com/blog/archives/76</link>
		<comments>http://associationthoughts.com/blog/archives/76#comments</comments>
		<pubDate>Thu, 30 Apr 2009 20:20:23 +0000</pubDate>
		<dc:creator>grantmcinnes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/archives/76</guid>
		<description><![CDATA[&#160; Commercial use of Twitter: Advertising job vacancies:]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Commercial use of Twitter: Advertising job vacancies:</p>
<p><a href="http://associationthoughts.com/blog/wp-content/uploads/2009/04/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://associationthoughts.com/blog/wp-content/uploads/2009/04/image-thumb.png" width="179" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/76/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opening Keynote</title>
		<link>http://associationthoughts.com/blog/archives/3</link>
		<comments>http://associationthoughts.com/blog/archives/3#comments</comments>
		<pubDate>Fri, 08 Aug 2008 21:11:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://associationthoughts.com/blog/?p=3</guid>
		<description><![CDATA[This blog is a collection of tips, tricks, thoughts, ideas and content related to working for an association and leveraging technology in order to make our jobs easier and more productive. We are an ASI customer and have used iMIS for 8 years as our AMS solution. Our desire is to share ideas and content related to [...]]]></description>
			<content:encoded><![CDATA[<p>This blog is a collection of tips, tricks, thoughts, ideas and content related to working for an association and leveraging technology in order to make our jobs easier and more productive. We are an ASI customer and have used iMIS for 8 years as our AMS solution. Our desire is to share ideas and content related to our experience with iMIS as well as what we are working on and hope that it will benefit other similar organizations.</p>
]]></content:encoded>
			<wfw:commentRss>http://associationthoughts.com/blog/archives/3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

