<?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>Jim&#039;s Code Bucket &#187; Objective&#45;C</title>
	<atom:link href="http://jamesborder.com/category/objectivec/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesborder.com</link>
	<description>misc code snippets</description>
	<lastBuildDate>Mon, 16 Aug 2010 15:29:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iphone provisioning hell</title>
		<link>http://jamesborder.com/2009/05/iphone-provisioning-hell/</link>
		<comments>http://jamesborder.com/2009/05/iphone-provisioning-hell/#comments</comments>
		<pubDate>Sat, 09 May 2009 05:01:06 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://jamesborder.com/site/iphone_provisioning_hell/#When:05:01:06Z</guid>
		<description><![CDATA[After googling and trying every solution in excruciating detail none worked. I&#8217;m completely convinced the error was related to rebuilding the app with the same name. The first version was already provisioned and running without problem on my phone, if this isn&#8217;t your problem then this won&#8217;t work for you. But if it is then [...]]]></description>
			<content:encoded><![CDATA[<p>After googling and trying every solution in excruciating detail none worked. I&#8217;m completely convinced the error was related to rebuilding the app with the same name. The first version was already provisioned and running without problem on my phone, if this isn&#8217;t your problem then this won&#8217;t work for you. But if it is then try it, it worked for me. </p>
<p>Take your .xcodeproj, .pch, main.m, class and .xib files (note not the build directory, not that I&#8217;m sure that matters) and dump them in the directory of the provisioned app, Build > Clean All Targets and poof&#8230;. it worked.</p>
<p>Here are some of the urls that I tried:</p>
<p>http://vehera.jsn&#45;server7.com/jana/blog/?p=141</p>
<p>http://blog.besiex.com/?p=45</p>
<p>http://iphoneincubator.com/blog/general/your&#45;mobile&#45;device&#45;has&#45;encountered&#45;an&#45;unexpected&#45;error&#45;0xe800003a</p>
<p>http://discussions.apple.com/thread.jspa?threadID=1833723&amp;tstart=0</p>
<p>http://www.24100.net/2009/02/iphone&#45;sdk&#45;mobile&#45;provisioning&#45;0xe800003a&#45;0xe8000001/</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesborder.com/2009/05/iphone-provisioning-hell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iphone movement alarm code</title>
		<link>http://jamesborder.com/2009/05/iphone-movement-alarm-code/</link>
		<comments>http://jamesborder.com/2009/05/iphone-movement-alarm-code/#comments</comments>
		<pubDate>Wed, 06 May 2009 03:18:21 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://jamesborder.com/site/iphone_movement_alarm_code/#When:03:18:21Z</guid>
		<description><![CDATA[.h file
// sensitivity level, 1.0 was way too sensitive 1.1 not enough
#define kAccelerationThreshold		1.07
#define kUpdateInterval			(1.0f/10.0f)
@interface MainViewController : UIViewController &#60;UIAccelerometerDelegate> {
.m file
&#45; (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {	
	if (fabsf(acceleration.x) > kAccelerationThreshold &#124;&#124;
		fabsf(acceleration.y) > kAccelerationThreshold &#124;&#124;
		fabsf(acceleration.z) > kAccelerationThreshold ) {
		// whatever needs to happen here in this case select a sound and then play it
		[self playSound: [self getSelectedSound] ];
	}
}
this [...]]]></description>
			<content:encoded><![CDATA[<p>.h file</p>
<p>// sensitivity level, 1.0 was way too sensitive 1.1 not enough<br />
#define kAccelerationThreshold		1.07<br />
#define kUpdateInterval			(1.0f/10.0f)</p>
<p>@interface MainViewController : UIViewController &#60;UIAccelerometerDelegate> {</p>
<p>.m file</p>
<p>&#45; (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {	</p>
<p>	if (fabsf(acceleration.x) > kAccelerationThreshold ||<br />
		fabsf(acceleration.y) > kAccelerationThreshold ||<br />
		fabsf(acceleration.z) > kAccelerationThreshold ) {</p>
<p>		// whatever needs to happen here in this case select a sound and then play it<br />
		[self playSound: [self getSelectedSound] ];</p>
<p>	}</p>
<p>}</p>
<p>this went in the &#45; (void)viewDidLoad {</p>
<p>	UIAccelerometer *accel = [UIAccelerometer sharedAccelerometer];<br />
	accel.delegate = self;<br />
	accel.updateInterval = kUpdateInterval;</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesborder.com/2009/05/iphone-movement-alarm-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opening a url in Safari</title>
		<link>http://jamesborder.com/2009/05/opening-a-url-in-safari/</link>
		<comments>http://jamesborder.com/2009/05/opening-a-url-in-safari/#comments</comments>
		<pubDate>Mon, 04 May 2009 03:51:33 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://jamesborder.com/site/opening_a_url_in_safari/#When:03:51:33Z</guid>
		<description><![CDATA[Here it is:
NSString* urlString = [NSString stringWithFormat:@"http://www.tldomain.com/"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
]]></description>
			<content:encoded><![CDATA[<p>Here it is:</p>
<p>NSString* urlString = [NSString stringWithFormat:@"http://www.tldomain.com/"];<br />
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesborder.com/2009/05/opening-a-url-in-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iphone random numbers</title>
		<link>http://jamesborder.com/2009/05/iphone-random-numbers/</link>
		<comments>http://jamesborder.com/2009/05/iphone-random-numbers/#comments</comments>
		<pubDate>Sun, 03 May 2009 21:32:35 +0000</pubDate>
		<dc:creator>me</dc:creator>
				<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://jamesborder.com/site/iphone_random_numbers/#When:21:32:35Z</guid>
		<description><![CDATA[In researching random number generation there seems to be alot of discussion as to the best way to go. These are the two ways I consider:
int generated = arc4random() % 10;
generated will be an integer between 0 and 10.
or 
srandom( time(NULL) );
int generated = ( random() % 10 );
]]></description>
			<content:encoded><![CDATA[<p>In researching random number generation there seems to be alot of discussion as to the best way to go. These are the two ways I consider:</p>
<p>int generated = arc4random() % 10;<br />
generated will be an integer between 0 and 10.</p>
<p>or </p>
<p>srandom( time(NULL) );<br />
int generated = ( random() % 10 );</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesborder.com/2009/05/iphone-random-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
