<?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>iDevKit</title>
	<atom:link href="http://idevkit.com/iphonedev/feed/" rel="self" type="application/rss+xml" />
	<link>http://idevkit.com/iphonedev</link>
	<description>An iPhone Developer&#039;s Blog</description>
	<lastBuildDate>Sat, 24 Apr 2010 17:47:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>At VTM 2010</title>
		<link>http://idevkit.com/iphonedev/2010/04/at-vtm-2010/</link>
		<comments>http://idevkit.com/iphonedev/2010/04/at-vtm-2010/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 17:47:55 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/2010/04/at-vtm-2010/</guid>
		<description><![CDATA[So I am over here at voices that matter in Seattle and will definitely be bringing back a good deal of information to the blog along with some open source stuff that I have been working on lately including some fancy uikit stuff and an exportation system for your application, will keep you all posted.
Sj
]]></description>
			<content:encoded><![CDATA[<p>So I am over here at voices that matter in Seattle and will definitely be bringing back a good deal of information to the blog along with some open source stuff that I have been working on lately including some fancy uikit stuff and an exportation system for your application, will keep you all posted.</p>
<p>Sj</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2010/04/at-vtm-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Voices That Matter &#8211; iPhone Developer Conferance</title>
		<link>http://idevkit.com/iphonedev/2010/02/voices-that-matter-iphone-developer-conferance/</link>
		<comments>http://idevkit.com/iphonedev/2010/02/voices-that-matter-iphone-developer-conferance/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 21:03:11 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Community News]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=194</guid>
		<description><![CDATA[
Alright, so we got some big news for everyone who is reading this right now, we have just been contacted by the Voices That Matter iPhone Developer Conferance people who would like to offer all of you a sweet $100 discount for this years event in beautiful Seattle, Washington!  I will be coming up [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.voicesthatmatter.com/iphone2010"><img src="http://idevkit.com/iphonedev/wp-content/uploads/2010/02/l_150_150_9221A278-F888-4327-ACC7-E00EA667A74E.jpeg" alt="" width="150" height="150" class="aligncenter size-full wp-image-364" /></a><br />
Alright, so we got some big news for everyone who is reading this right now, we have just been contacted by the Voices That Matter iPhone Developer Conferance people who would like to offer all of you a sweet $100 discount for this years event in beautiful Seattle, Washington!  I will be coming up from Arizona for it, along with possibly MxWeas.  I would like to encourage all of you to come and hang out with us for the weekend (April 24 &#038; 25).  There is also a special for tickets ending on March 12th of another $200 off, so I think you guys got it pretty good!  More info from them after the bump.  Oh, and <b>Erica Sadun is the technical chair this year</b>, so you know, come.</p>
<p><a href="http://idevkit.com/iphonedev/wp-content/uploads/2010/02/l_142_118_15CE9D87-84A0-4DEB-85F8-AB94D679E16F.jpeg"><img src="http://idevkit.com/iphonedev/wp-content/uploads/2010/02/l_142_118_15CE9D87-84A0-4DEB-85F8-AB94D679E16F.jpeg" alt="" width="142" height="118" class="aligncenter size-full wp-image-364" /></a></p>
<p>Straight from the horses mouth:</p>
<p>Coming to you direct from Addison-Wesley Professional, which has published some of the leading books in the field, the Voices That Matter: iPhone Developers Conference is taking place April 24-25 in Seattle! This conference is designed for Mac developers looking for a succinct, easy way to get up to speed on the specific skills needed to build, test and distribute successful applications for the iPhone, iPad, and iPod touch. Erica Sadun, author of “The iPhone Developer’s Cookbook” is the event’s technical chair. She’ll lead an epic group of speakers at the conference including Aaron Hillegass, August Trometer, Suzanne Ginsburg, Erik Buck, Michael Daley, Joe Conway, Jonathan Rentzsch, Kevin Avila and lots of others.</p>
<p>At this unique event, you will:<br />
• Learn the skills needed to build, test, and distribute successful iPhone and iPad applications<br />
• Choose the session topics you need to become an iPhone and iPad development master<br />
• Network with developers equally as passionate about this exciting platform and where it’s going<br />
• Leverage your existing skills in a new and profitable way</p>
<p>SPECIAL SAVINGS! As someone that reads this blog, you can save $100 off the conference fee by providing priority code PHBLOGS when registering. Register before March 12th and save a total of $300 as this $100 discount is combined with the early bird pricing!</p>
<p><a href="http://idevkit.com/iphonedev/wp-content/uploads/2010/02/l_225_101_6737A93E-2678-41AB-8566-1CACAC7CC38A.jpeg"><img src="http://idevkit.com/iphonedev/wp-content/uploads/2010/02/l_225_101_6737A93E-2678-41AB-8566-1CACAC7CC38A.jpeg" alt="" width="225" height="101" class="aligncenter size-full wp-image-364" /></a></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2010/02/voices-that-matter-iphone-developer-conferance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time for Apple&#8217;s &#8220;Latest Creation&#8221;!</title>
		<link>http://idevkit.com/iphonedev/2010/01/time-for-apples-latest-creation/</link>
		<comments>http://idevkit.com/iphonedev/2010/01/time-for-apples-latest-creation/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 16:52:15 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/2010/01/time-for-apples-latest-creation/</guid>
		<description><![CDATA[In just over one hour we will finally get to see what Apple&#8217;s &#8220;Latest Creation&#8221; is and broadcast it to the dev team.  Along with a rumored OS 4.0 we could all get very busy very quickly with the new working mediums.  Stay tuned for updates throughout the day.
**UPDATE**
iPad is now official!  We [...]]]></description>
			<content:encoded><![CDATA[<p>In just over one hour we will finally get to see what Apple&#8217;s &#8220;Latest Creation&#8221; is and broadcast it to the dev team.  Along with a rumored OS 4.0 we could all get very busy very quickly with the new working mediums.  Stay tuned for updates throughout the day.</p>
<p>**UPDATE**</p>
<p>iPad is now official!  We are looking at 9.7&#8243; screen with a bit of a bezel around the edge, Wireless N built right in, can play EVERY SINGLE IPHONE APPLICATION, in house applications have had a major revamp and look gorgeous, and from the looks of it it will be running on <span style="text-decoration: line-through;">VERIZON 3G</span> UPDATE: WSJ today announced that AT&amp;T will be the sole carrier of the iPad<span style="text-decoration: line-through;">.</span> Pictures curtousy of Gizmodo and Gdgt:</p>
<p><a href="http://www.gizmodo.com"><img class="aligncenter" title="Source Gizmodo" src="http://cache.gizmodo.com/assets/appletablet/appletabletb426.jpg" alt="" width="600" height="399" /></a><a href="http://www.gizmodo.com"><img class="aligncenter" title="Source Gizmodo" src="http://cache.gizmodo.com/assets/appletablet/appletabletb279.jpg" alt="" width="600" height="399" /></a><a href="http://www.gizmodo.com"><img class="aligncenter" title="Source Gizmodo" src="http://cache.gizmodo.com/assets/appletablet/appletabletb343.jpg" alt="" width="600" height="399" /></a><a href="http://www.gizmodo.com"><img class="aligncenter" title="Source Gizmodo" src="http://cache.gizmodo.com/assets/appletablet/appletabletb342.jpg" alt="" width="600" height="399" /></a></p>
<p>WE WILL BE POSTING TUTORIALS IN THE COMING DAYS FOR DEVELOPERS!</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2010/01/time-for-apples-latest-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Late late late on updates&#8230;</title>
		<link>http://idevkit.com/iphonedev/2009/11/late-late-late-on-updates/</link>
		<comments>http://idevkit.com/iphonedev/2009/11/late-late-late-on-updates/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 01:09:31 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Community News]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=176</guid>
		<description><![CDATA[Hi everyone, sorry for the delayed updates recently, everyone has kinda been busy with personal lives and so on and such forth. Quick note I wanted to make, we want to make this website a little more&#8230;&#8221;advanced&#8221;&#8230;then other blogs. Yes, we have been doing a lot of UIKit kind of stuff and we will do [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone, sorry for the delayed updates recently, everyone has kinda been busy with personal lives and so on and such forth. Quick note I wanted to make, we want to make this website a little more&#8230;&#8221;advanced&#8221;&#8230;then other blogs. Yes, we have been doing a lot of UIKit kind of stuff and we will do a little bit more, but that is only because, in order to write an iphone application, you need to be able to understand the process of sending your information etc out. I will be starting a relatively indepth tutorial on UITableViews, UITableViewCell customization and so on here hopefully this weekend, then we will start getting our hands a bit more dirty.</p>
<p>Regards,<br />
Sj</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/11/late-late-late-on-updates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New iMac, MacMini, Magic Mouse, and Updated MacBook</title>
		<link>http://idevkit.com/iphonedev/2009/10/new-imac-macmini-magic-mouse-and-updated-macbook/</link>
		<comments>http://idevkit.com/iphonedev/2009/10/new-imac-macmini-magic-mouse-and-updated-macbook/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 19:05:00 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Community News]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=163</guid>
		<description><![CDATA[This morning, the folks up in Cupertino announced the new updated line of mac products (sans the Mac Book Pro).  There was a lot of big news so lets start with what everyone wants to see first.
The Brand New iMac:
-The new iMac boasts a 21.5&#8243; and 27&#8243; monitor with IPS Technology, letting you get better [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, the folks up in Cupertino announced the new updated line of mac products (sans the Mac Book Pro).  There was a lot of big news so lets start with what everyone wants to see first.</p>
<p><strong>The Brand New iMac:</strong></p>
<p>-The new iMac boasts a 21.5&#8243; and 27&#8243; monitor with IPS Technology, letting you get better resolution from every angle and an LED backlight.  The resolution has also been boosted  to 2560-by-1440 pixel resolution.<br />
-The processing speed for the new line has also been drastically increased.  We are looking at Core 2 Duo&#8217;s up to 3.33GHz for the 21.5&#8243; models and Quad-Core&#8217;s of 2.66GHz (Core i5) and 2.8GHz (Core i7) for the 27&#8243; model.<br />
-Graphic cards have also been upgraded to  256MB ATI Radeon HD 4670 for the 21.5&#8243; and a 512MB ATI Radeon HD 4850 for the 27&#8243;.<br />
-From a memory stand point, the iMac now supports up to 16GB of RAM and an HDD of up to 2TB.</p>
<p><img class="aligncenter size-full wp-image-167" title="iMac - 2009" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/10/34350.95Apple-New-Macs.sff.jpg" alt="iMac - 2009" width="220" height="174" /></p>
<p><strong>Magic Mouse:</strong></p>
<p>-This is the latest mouse out of Cupertino and it is coming with a serious overhaul, we are talking about multitouch capabilities.<br />
-It supports standard clicking, right-clicking, 360 degree scrolling on the surface along with screen zooming.</p>
<p><img class="aligncenter size-medium wp-image-169" title="Magic Mouse" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/10/500x_apple-mouse-pro-via-magic-mouse-242x300.jpg" alt="Magic Mouse" width="242" height="300" /></p>
<p><strong>Mac Mini:</strong></p>
<p>-The updates to this little guy start at the processing speed, which has been pushed up to a Core 2 Duo 2.53GHz processor.<br />
-The Mini now allows for up to 4GB of RAM and a 500GB HDD.<br />
-Graphics have also been upgraded, now shipping with an NVIDIA GeForce 9400M card.</p>
<p><img class="aligncenter size-medium wp-image-172" title="MacMini - 2009" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/10/leak-macmini-300x146.jpg" alt="MacMini - 2009" width="300" height="146" /></p>
<p><strong>MacBook:</strong></p>
<p>-A new unibody design (similar to the Pros) is now used, no other major upgrades have been mentioned.</p>
<p><img class="aligncenter size-medium wp-image-165" title="MacBook - 2009" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/10/overview_hero1_20091020-300x132.jpg" alt="MacBook - 2009" width="300" height="132" /></p>
<p> </p>
<p>(most images courtesy of APPLE)</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/10/new-imac-macmini-magic-mouse-and-updated-macbook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>blackra1n</title>
		<link>http://idevkit.com/iphonedev/2009/10/blackra1n/</link>
		<comments>http://idevkit.com/iphonedev/2009/10/blackra1n/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 07:55:53 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Toolchain (Unofficial Dev)]]></category>
		<category><![CDATA[iPhone Dev Team]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=158</guid>
		<description><![CDATA[Alright everyone, quick update for all you up at 1am and happen to have bought an iPod Touch 3rd Gen because they had a coupon they didn&#8217;t want to expire then realized that they really needed it to be jailbroken to write an app.  geohot has release blackra1n, this is the jailbreak for EVERY [...]]]></description>
			<content:encoded><![CDATA[<p>Alright everyone, quick update for all you up at 1am and happen to have bought an iPod Touch 3rd Gen because they had a coupon they didn&#8217;t want to expire then realized that they really needed it to be jailbroken to write an app.  geohot has release blackra1n, this is the jailbreak for EVERY SINGLE IPOD AND IPHONE RUNNING 3.1.2.  It is only on Windows at the moment but hopefully it is working on migration.  It is INCREDIBLY simple, you just need to download it from blackra1n.com, make sure the .exe is in the c:/ drive, plug in your ipod/iphone and run.  30 seconds later and you are done.  This does not support a carrier unlock at this time so DO NOT USE IT IF YOU RELY ON HAVING YOUR PHONE UNLOCKED. Once its done its thing, open up the blackra1n app on the springboard and install Cydia.  Good to go! Goodluck!</p>
<p>**EDIT** After a reboot during class I realized that it was a tethered jailbreak, meaning that you cannot turn it on when it is not connected directly to blackra1n.</p>
<p>Regards,<br />
sj</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/10/blackra1n/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Saving NSMutableArrays</title>
		<link>http://idevkit.com/iphonedev/2009/09/saving-nsmutablearrays/</link>
		<comments>http://idevkit.com/iphonedev/2009/09/saving-nsmutablearrays/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 23:44:25 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[iPhone SDK (Official Dev)]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=134</guid>
		<description><![CDATA[Good day lads and lasses of the internet, I decided that saving data files for your applications is an important one to know and saving objects in an NSMutableArray wants you to occasionally make you gouge your eyes out until you get the system lined up pretty well.  Let us start with the order [...]]]></description>
			<content:encoded><![CDATA[<p>Good day lads and lasses of the internet, I decided that saving data files for your applications is an important one to know and saving objects in an NSMutableArray wants you to occasionally make you gouge your eyes out until you get the system lined up pretty well.  Let us start with the order of events here for saving and loading.  <strong>Create and NSMutableArray with your object -&gt; Locate the directory and the file to save to -&gt; Encode the array into an NSMutableData file -&gt; Store the NSMD in the given directory</strong> Simple enough.  For loading, its really the same  system just backward I guess you could say.  We&#8217;ll go into that a little bit later.  For now, <strong>Open Xcode -&gt; New Project -&gt; &#8220;View Based Application&#8221; -&gt; &#8220;New File&#8221; -&gt; &#8220;Objective-C Class&#8221; -&gt; Call it theFile and check the box for a header file</strong>.  At this point, I am going to expect you all to know how to do some of these remedial tasks.  Go to your header for this new file and declare two <code>NSString</code>s along with their <code>@property/@synthesize</code> declarations at the end of the header and start of the <code>@implementation</code>.  This is the object that we are going to toss into our <code>NSSMutableArray</code> later, which means we are going to have to conform to some protocols designated by the foundation framework.  Let us assume you called your two <code>NSString</code>s <code>textField</code> and <code>numberField</code> (mainly because that is how I named them in the sample code, there are a few treats in there that use styles and all for text fields etc that weren&#8217;t mentioned before).  We will need to implement both the <code>encoder</code> and <code>decoder</code> methods here and thats it.  Add the following code to the implementation of <code>theFile</code>:</p>
<pre>- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:textField forKey:@"text"];
    [encoder encodeObject:numberField forKey:@"number"];
}

-(void)initWithCoder:(NSCoder *)coder {
	textField = [[coder decodeObjectForKey:@"text"] retain];
	numberField = [[coder decodeObjectForKey:@"number"] retain];
}</pre>
<p>First off is the <code>encode</code> protocol, all we are doing here is encoding the two strings inside of the <code>theFile</code> and giving them a reference string so that we can locate them later.  The other method does the opposite of that, it decodes both objects for the given keys and stores them in those strings.  With that, we can move on to the quick user interface I wrote for this.  We are going to want two <code>UITextField</code>s to control the content of the strings in our custom object, two <code>UIButtons</code> to save and load the data, and a <code>UILabel</code> to display the loaded contents.  Same thing as we did in our previous tutorial that introduced our world of iDevKit to the <code>UITextField</code>, <code>UILabel</code>, and <code>UIButton</code>, which can be found <a title="UITextFields and UIButtons" href="http://idevkit.com/iphonedev/2009/09/uitextfields-and-uibuttons/" target="_blank">here</a>.  I will give you the set up code here for all the UI today but this will probably be the last time until something new is tutorialized.  Add the <code>UITextField</code>s to the header of your viewController class (<code>labelField, numberField<code>UIButtons</code> (<code>saveItems, loadItems<code>theFile *value;</code>.</code></code></p>
<pre>- (void)loadView {
     CGRect frame = [UIScreen mainScreen].applicationFrame;
     UIView *view = [[UIView alloc] initWithFrame:frame];
     self.view = view;

     displayLoad = [[UILabel alloc] initWithFrame:CGRectMake(10,140,300,28)];
     displayLoad.font = [UIFont fontWithName:@"Arial" size:16];

     [self saveItems];
     [self loadItems];
     [self labelField];
     [self numberField];
     [self.view addSubview:saveItems];
     [self.view addSubview:loadItems];
     [self.view addSubview:labelField];
     [self.view addSubview:numberField];
     [self.view addSubview:displayLoad];
}

-(UIButton *)saveItems {
     saveItems = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
     saveItems.frame = CGRectMake(50,222,90,45);
     [saveItems setTitle:@"Save" forState:UIControlStateNormal];
     [saveItems setTitle:@"Save" forState:UIControlStateHighlighted];
     [saveItems setTitleColor:[UIColor colorWithRed:0.0 green:0.3 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
     [saveItems setTitleColor:[UIColor colorWithRed:0.0 green:0.1 blue:1.0 alpha:1.0] forState:UIControlStateHighlighted];
     [saveItems setBackgroundColor:[UIColor clearColor]];
     [saveItems addTarget:self action:@selector(saveObjects) forControlEvents:UIControlEventTouchUpInside];

     return saveItems;
}

-(UIButton *)loadItems {
     loadItems = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
     loadItems.frame = CGRectMake(180,222,90,45);
     [loadItems setTitle:@"Load" forState:UIControlStateNormal];
     [loadItems setTitle:@"Load" forState:UIControlStateHighlighted];
     [loadItems setTitleColor:[UIColor colorWithRed:0.0 green:0.3 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
     [loadItems setTitleColor:[UIColor colorWithRed:0.0 green:0.1 blue:1.0 alpha:1.0] forState:UIControlStateHighlighted];
     [loadItems setBackgroundColor:[UIColor clearColor]];
     [loadItems addTarget:self action:@selector(loadObjects) forControlEvents:UIControlEventTouchUpInside];

     return loadItems;
}

-(UITextField *)labelField {
     if (labelField == nil) {
          CGRect frame = CGRectMake(20,100,280,30);
          labelField = [[UITextField alloc] initWithFrame:frame];

          labelField.borderStyle = UITextBorderStyleRoundedRect;
          labelField.textColor = [UIColor blackColor];
          labelField.font = [UIFont systemFontOfSize:17.0];
          labelField.placeholder = @"Type Something...";
          labelField.backgroundColor = [UIColor clearColor];
          labelField.autocorrectionType = UITextAutocorrectionTypeNo;

          labelField.keyboardType = UIKeyboardTypeDefault;
          labelField.returnKeyType = UIReturnKeyDone;

          labelField.clearButtonMode = UITextFieldViewModeWhileEditing;

          labelField.tag = 1;

          labelField.delegate = self;
     }
     return labelField;
}

-(UITextField *)numberField {
     if (numberField == nil) {
          CGRect frame = CGRectMake(20,50,280,30);
          numberField = [[UITextField alloc] initWithFrame:frame];

          numberField.borderStyle = UITextBorderStyleRoundedRect;
          numberField.textColor = [UIColor blackColor];
          numberField.font = [UIFont systemFontOfSize:17.0];
          numberField.placeholder = @"Numbers...";
          numberField.backgroundColor = [UIColor clearColor];
          numberField.autocorrectionType = UITextAutocorrectionTypeNo;

          numberField.keyboardType = UIKeyboardTypeNumberPad;
          numberField.returnKeyType = UIReturnKeyDone;

          numberField.clearButtonMode = UITextFieldViewModeWhileEditing;

          numberField.tag = 1;	

          numberField.delegate = self;
     }
     return numberField;
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField {
     [textField resignFirstResponder];
     return YES;
}</pre>
<p>Not going to reinvent the wheel here so if you have any questions, consult the project I attach to the end of this or previous tutorials, there is <strong>NOTHING NEW</strong>.  Alrighty then, notice that the <code>UIButtons</code> send us to two separate methods: <code>saveObjects</code> and <code>loadObjects</code>.  Let us start with saving:</p>
<pre>-(void)saveObjects {
	value = [[theFile alloc] init];
	value.textField = labelField.text;
	value.numberField = numberField.text;

	NSMutableArray *array = [NSMutableArray arrayWithObjects:value,nil];
	NSMutableData *data = [NSMutableData data];
	NSKeyedArchiver *encode = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];

	NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *docDirectory = [path objectAtIndex:0];
	NSString *file = [docDirectory stringByAppendingPathComponent:@"save.iDK"];
	NSLog(file);

	[encode encodeObject:array forKey:@"save"];
	[encode finishEncoding];

	[data writeToFile:file atomically:YES];
	[encode release];
}</pre>
<p>Okay then&#8230; First three lines are going to allocate/initialize an instance of <code>theFile</code> and set both of the strings inside of it to the values set in our <code>UITextField</code>s.  After that, we create an <code>NSMutableArray</code> and store <code>value</code> inside of it, where <code>nil</code> denotes the end of the array.  We then create a data file that will later house our array, we use <code>NSMutableData</code> for this.  Then we declare an <code>NSKeyedArchiver</code> that will be used in encoding our data file.  Now comes a really important step: locating our save directory.  This part I just kind of pulled as stock code from Apple but I will do my best to tell you what is going on.  The first line there finds us our local path to our app, then it finds the contained Documents directory.  We then extract the string from the array that will then be used to place our <code>file</code><code>NSLog()</code> here so we can find our application directory for the simulator if we are so inclined.  Few more steps: we encode our NSMA and to a reference point for later and push the encoding along.  After that, we write the <code>data</code> to our <code>file</code>, clean memory, and we are saved!  Almost done, now to add in our decoder bit, add our <code>loadObjects</code> method and lets begin.</p>
<pre>-(void)loadObjects {
	NSFileManager *manager = [NSFileManager defaultManager];

	NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *docDirectory = [path objectAtIndex:0];
	NSString *file = [docDirectory stringByAppendingPathComponent:@"save.iDK"];

	if([manager fileExistsAtPath:file]) {
		NSLog(@"file located and reading");

		NSMutableData *data;
		NSMutableArray *array;
		NSKeyedUnarchiver *decode;
		NSString *label;

		if(!value)	value = [[theFile alloc] init];

		data = [NSData dataWithContentsOfFile:file];
		decode = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
		array = [decode decodeObjectForKey:@"save"];
		[decode finishDecoding];
		[decode release];
		value = [array objectAtIndex:0];

		label = value.textField;
		label = [label stringByAppendingString:value.numberField];

		displayLoad.text = label;
	} else {
		NSLog(@"file not found, save something to create the file");
	}
}</pre>
<p>First up is we create what is called an <code>NSFileManager</code> and we set the value of this instance to <code>defaultManager</code>; in a nutshell, this is just creating an object that we will later use to look for a file and return a boolean value on whether or not it exists.  After that we do like we did before in the saving method and locate our file&#8217;s directory and name (not to be confused with the file itself, this just tells the device where the file SHOULD exist and what it SHOULD be called if it does exist).  Now we use a simple <code>if-else</code> statement that uses our <code>manager</code> to check to see if our file located at <code>file</code> exists, and if so, it will load it, if not, it sends an error message to the console and ends the method.  Let us assume it exists, otherwise its just boring and you won&#8217;t learn anything.  To start with we will declare the same variables we did while saving, with exception to the <code>NSKeyedArchiver</code>, which we replaced with the inverse: <code>NSKeyedUnarchiver</code>.  We also put in an <code>NSString</code> to store the displayed string in later.  The next line checks to see whether or not we have already allocated <code>value</code>, and if not, then we allocate it, simple &#8217;nuff.  We now pull the <code>NSMutableData</code> file from our Documents directory that we proved existed, and store it in <code>data</code>.  We decode the data file from there using our unarchiver and search for an <code>NSMutableArray</code> inside it using the key that we archived with before.  We push the decoder along while we store the array in <code>array</code>, clean the memory a little, and pull the first value from the array and store it in <code>value</code>.  From here is all cosmetic, we take the two strings in our new object, combine them, and set the <code>UILabel</code> text to it.</p>
<p><img class="alignleft size-full wp-image-152" title="B&amp;G Final" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/09/Picture-43.png" alt="B&amp;G Final" width="72" height="53" /></p>
<p>Thats about it, if you have any questions just ask, you can find the source code <a title="Source Code for Saving Tutorial" href="http://idevkit.com/iphonedev/wp-content/uploads/2009/09/iDK-Saving.zip">here</a>.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="User Interface" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/09/Picture-2-199x300.png" alt="User Interface" width="199" height="300" /><br />
<img style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="Saving Console" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/09/Picture-31.png" alt="Saving Console" width="652" height="308" /></p>
<p>Regards,</p>
<p>Sj</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/09/saving-nsmutablearrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UITextFields and UIButtons</title>
		<link>http://idevkit.com/iphonedev/2009/09/uitextfields-and-uibuttons/</link>
		<comments>http://idevkit.com/iphonedev/2009/09/uitextfields-and-uibuttons/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 00:14:17 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[iPhone SDK (Official Dev)]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=90</guid>
		<description><![CDATA[Hi again everyone, sorry for the late update, I have been pretty busy with another project for the blog this past week, along with a few other jobs/projects unrelated to this.  I still have yet to finish that other tutorial so I thought I would throw something together today that most of you guys will [...]]]></description>
			<content:encoded><![CDATA[<p>Hi again everyone, sorry for the late update, I have been pretty busy with another project for the blog this past week, along with a few other jobs/projects unrelated to this.  I still have yet to finish that other tutorial so I thought I would throw something together today that most of you guys will find relatively helpful (I hope).  So here we have it, a little tutorial that covers labels (nothing new at all here), textfields, buttons, and NSUserDefaults.  Alright, lets begin, open Xcode and create a new View Based Application, name it TextInput.</p>
<p>Navigate to TextInputViewController.h and you will need to declare the UITextFieldDelegate protocol by adding <code>&lt;UITextFieldDelegate&gt;</code> after <code>TextInputViewController : UIViewController</code>, this will tell your program that it needs to conform to the UITextFieldDelegate protocol, which in turn, allows you to create UITextFields.  Now, in the @interface section, declare two UILabels, two UITextFields, and two UIButtons like so:</p>
<pre>UILabel *firstLbl;
UILabel *lastLbl;
UITextField *firstName;
UITextField *lastName;
UIButton *saveBtn;
UIButton *loadBtn;,</pre>
<p>Under that, make sure to add the following code outside of the brackets but before the <code>@end</code>, this will let you control the UIButtons and UITextFields:</p>
<pre>@property(nonatomic,retain) UITextField *firstName;
@property(nonatomic,retain) UITextField *lastName;
@property(nonatomic,retain) UIButton *saveBtn;
@property(nonatomic,retain) UIButton *loadBtn;</pre>
<p>Now, go to your TextInputViewController.m and uncomment the <code>loadView</code> method.  Create a UIView now to fit the frame of the screen and set it to the <code>self.view</code>:</p>
<pre>CGRect frame = [UIScreen mainScreen].applicationFrame;
UIView *view = [[UIView alloc] initWithFrame:frame];
self.view = view;</pre>
<p><strong>NOTE: This is the last time I will be explaining how to create the viewController&#8217;s main view, same goes with generic labels that we will be using a lot, which will follow</strong><br />
From here, we need to prepare and initialize all of your views and objects that we will be using in the main viewController.  Starting with the labels:</p>
<pre>firstLbl = [[UILabel alloc] initWithFrame:CGRectMake(20,10,320,32)];
lastLbl = [[UILabel alloc] initWithFrame:CGRectMake(20,70,320,32)];
firstLbl.backgroundColor = [UIColor clearColor];
lastLbl.backgroundColor = [UIColor clearColor];</pre>
<p>This is simple, we are preparing the UILabels for the loaded data that we will be accessing later.  I didn&#8217;t bother setting any other properties for these labels, this isn&#8217;t a UILabel tutorial, I covered more of that in the <a title="iDevKit - Hello World" href="http://idevkit.com/iphonedev/2009/09/xcode-and-the-iphone-sdk/" target="_blank">Hello World tutorial </a>a couple of weeks ago.  After that, we get into the new stuff, the fun stuff.  You will need to start by creating a method that looks something like this:</p>
<pre>- (UITextField *) firstName {
     if(firstName == nil) {
          CGRect frame = CGRectMake(20,40,280,30);
          firstName = [[UITextField alloc] initWithFrame:frame];

          firstName.borderStyle = UITextBorderStyleRoundedRect;
          firstName.textColor = [UIColor blackColor];
          firstName.font = [UIFont systemFontOfSize:17.0];
          firstName.placeholder = @"First Name...";
          firstName.autocorrectionType = UITextAutoCorrectionTypeNo;

          firstName.keyboardType = UIKeyboardTypeDefault;
          firstName.returnKeyType = UIReturnKeyDone;

          firstName.clearButtonMode = UITextFieldViewModeWhileEditing;

          firstName.delegate = self;
     }
     return firstName;
}</pre>
<p>Alright, there are a <strong>LOT</strong> of new concepts here, all of which pertaining to setting up your customized UITextField, we will be using this again in a moment.  First off, we have an <code>if</code> statement that checks to see if the text field has already been allocated and initialized, if the <code>firstName</code> returns a <code>nil</code> value, then the enclosed statements are executed, if it doesn&#8217;t, then it just returns the already allocated UITextField.  Assuming that the statement was satisfied, lets step through all of the properties of the text field.  Like with most of the <code>UIKit</code> objects, you need to set the text field inside of a frame using the <code>CGRectMake</code> method.  We initialize <code>firstName</code> with this frame.  Then we set the <code>borderStyle</code>, this is what the frame of the field will look like, I used the <code>UITextBorderStyleRoundedRect</code> style here, which, like it says, makes the frame rounded on the corners.  <code>textColor</code> sets the input text&#8217;s color and <code>font</code> sets the font size of that input, similar to that used in a UILabel.  We use <code>placeholder</code> to fill the UITextField with a background text until it is touched and/or has any input.  <code>autocorrectionType</code> sets whether or not to use the iPhone&#8217;s auto-correct dictionary with input, I set this to no for proof and practice, the default is YES.  The <code>keyboardType</code> and <code>returnKeyType</code> properties delegate the keyboard settings, the first sets it to the standard keyboard and the latter sets the return key to say <code>Done</code> and to dismiss the keyboard.  Almost done, <code>clearButtonMode</code> property tells us whether or not to use the little gray &#8216;X&#8217; that clears the field.  Finally, <code>delegate</code> tells the text field that it is being controlled by this particular view controller.  We return the UITextField now at the end.</p>
<p>We use this method form again for the <code>lastName</code>, replacing <code>firstName</code> with <code>lastName</code> and changing any properties based on what you want to play with.  Remember, hit <code>Esc</code> on your keyboard to list the available options for each property after the &#8216;=&#8217; sign.</p>
<p>Add the following code to dismiss the keyboard when <code>Done</code> is clicked:</p>
<pre>- (BOOL) textFieldShouldReturn:(UITextField *)textField {
     [textField resignFirstResponder];
     return YES;
}</pre>
<p>Now we need to start setting up the buttons that save and load the data:</p>
<pre>- (UIButton *) saveBtn {
     saveBtn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
     saveBtn.frame = CGRectMake(0,0,90,45);
     [saveBtn setTitle:@"Save" forState:UIControlStateNormal];
     [saveBtn setTitle:@"Save" forState:UIControlStateHighlighted];
     [saveBtn setTitleColor:[UIColor colorWithRed:0.0 green:0.3 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
     [saveBtn setTitleColor:[UIColor colorWithRed:0.0 green:0.1 blue:1.0 alpha:1.0]  forState:UIControlStateHighlighted];
     [saveBtn setBackgroundColor:[UIColor clearColor]];
     [saveBtn addTarget:self action:@selector(saveText) forControlEvents:UIControlEventTouchUpInside];
     return saveBtn;
}</pre>
<p>Alrighty then, same idea as the UITextField method, we are just setting a group of properties for the UIButton.  First we set the type of button we want to <code>UIButtonTypeRoundedRect</code> and <code>retain</code> the view.  Next is the <code>frame</code> as always, the x,y coordinates are set to 0 because frankly, I prefer to set the location of UIButtons using the center point, which I will show later.  Button&#8217;s titles and images etc are based off of the <code>UIControlState</code> of the button.  First, we set the <code>title</code> of the button at its <code>UIControlStateNormal</code>, in this case it just says &#8220;Save&#8221;; we use the same statement again below, except using <code>UIControlStateHighlighted</code>, this sets the title of the button when it is clicked down.  We set the <code>titleColor</code> now for both states to a custom UIColor value, followed by the <code>backgroundColor</code> property, which makes the outside of the frame meld with the background&#8217;s color or image.  Finally, the most important bit of code is the <code>addTarget:action:forControlEvents:</code> that tells the program to execute the method <code>saveText</code> inside of <code>self</code> when the user performs a <code>UIControlEventTouchUpInside</code>, aka a touch of the button.  We return the button and continue.</p>
<p>Do this again with loadBtn, only this time make sure to change that second to last line to:</p>
<pre>[loadBtn addTarget:self action:@selector(loadText) forControlEvents:UIControlEventTouchUpInside];</pre>
<p>Configure it how ever you wish and play around with the properties, the best way to learn how to program is trial by error.</p>
<p>Now before we put this all together in our <code>loadView</code> method, we have two more bits of code to write, and these will be the ones the let us save and load our data: <code>saveText</code> and <code>loadText</code>.  Let us start with the first one, insert the following code after the UITextField and UIButton methods:</p>
<pre>[[NSUserDefaults standardUserDefaults] setObject:firstName.text forKey:@"firstName"];
[[NSUserDefaults standardUserDefaults] setObject:lastName.text forKey:@"lastName"];
[[NSUserDefaults standardUserDefaults] synchronize];
firstName.text = @"";
lastName.text = @"";</pre>
<p>Alright, new concept here: <code>NSUserDefaults</code>.  This is the Foundation Frameworks method of saving the default settings for a program along with other bits of data.  The first two methods are essentially identical, you start by calling <code>standarUserdefaults</code> which tells the next commands to look in the standard library of saved data.  Next, we need to save the string from the UITextField, which is done by using <code>setObject:</code> and then the string, which is the <code>text</code> property of your text field, and finally, we need to tell the computer where exactly to look when we want to load this, so we set <code>forKey:</code> to the name of the variable.  <strong>NOTE: I usually do it this way as an organizational method but you can set the <code>forKey</code> to whatever you want.  Also, if you poke around through the documentation from Apple, you can get the methods to save other types of data.</strong> Last new bit of code here is the <code>synchronize</code> method, which tells the program to pretty much save and do so now.  If you do not use this, when you are saving larger bits of data there is a chance that it does not save before the application is exited, at which point you can lose an entire saved game, as was the case with an error I was having on an application I wrote a while back.  Nothing new after that, these two calls just clear the text fields, I used this as a little visual aid to indicate that something actually happened.</p>
<p>Okay, almost done&#8230; now we just need to tell the program just how to load the data that we previously saved.  Add:</p>
<pre>NSString *first = [[NSString alloc] initWithString:[[NSUserDefaults standardUserDefaults] objectForKey:@"firstName"];
NSString *last = [[NSString alloc] initWithString:[[NSUserDefaults standardUserDefaults] objectForKey:@"lastName"];
firstLbl.text = first;
lastLbl.text = last;
[first release];
[last release];</pre>
<p>Alright, just the normal NSString declartaion/allocation/initialization is used here, we all know how to use that, the new part comes with the string that we are initializing the variable with.  We do as we did before and tell NSUserDefaults to use the <code>standardUserDefaults</code>, then we tell it to load the object that has a matching key to the one we put after <code>objectForKey</code>, if there is an object there, it loads it, if not, nothing happens, simple as that.  We do the same thing again only loading a different object this time.  <strong> NOTE: I am relatively sure that you can use <code>stringForKey:</code> instead although I have never had a reason to so play with it as you will.</strong> Now we place those strings inside of the UILabels, release the retained memory from the strings and move on to the last little thing, putting it all in play.  Back to the <code>loadView</code> method, insert:</p>
<pre>[self firstName];
[self lastName];
[self saveBtn];
[self loadBtn];
[saveBtn setCenter:CGPointMake(100,200)];
[loadBtn setCenter:CGPointMake(220,200)];
[self.view addSubview:firstName];
[self.view addSubview:lastName];
[self.view addSubview:saveBtn];
[self.view addSubview:loadBtn];
[self.view addSubview:firstLbl];
[self.view addSubview:lastLbl];</pre>
<p>This is what makes everything activate and come alive.  The first 4 lines execute your button and text field methods that initialze and allocate them with your custom settings.  The following two set the center of the buttons to exactly where I want them, I find this easier for most subviews.  The last 6 lines add everything to the superview.  That is it, make sure that you <code>release</code> everything that you retained in the <code>dealloc</code> method, <strong>Build &amp; Go</strong>.</p>
<div id="attachment_126" class="wp-caption aligncenter" style="width: 400px"><img class="size-full wp-image-126" title="Final Version" src="http://idevkit.com/iphonedev/wp-content/uploads/2009/09/Picture-41.png" alt="I changed the background color the same way we did in Hello World" width="390" height="738" /><p class="wp-caption-text">I changed the background color the same way we did in Hello World</p></div>
<p>That is all for now, you can get the sample code <a title="TextInput Source" href="http://idevkit.com/iphonedev/wp-content/uploads/2009/09/iDK-TextInput.zip">here</a>.</p>
<p>Regards,<br />
sj</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/09/uitextfields-and-uibuttons/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s Rock and Roll Event</title>
		<link>http://idevkit.com/iphonedev/2009/09/apples-rock-and-roll-event/</link>
		<comments>http://idevkit.com/iphonedev/2009/09/apples-rock-and-roll-event/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 19:14:02 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Community News]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/?p=77</guid>
		<description><![CDATA[Apple announced all the new iPod and iTunes updates today, there was a lot to see but at the same time there were a few disappointments for the iPod development community.
iTunes 9

Genius feature updated
iTunes LP, this is the new iTunes metadata interaction, it contains lyrics, large images, chronology etc.
Updated artist pages in the iTunes Store
Interactive [...]]]></description>
			<content:encoded><![CDATA[<p>Apple announced all the new iPod and iTunes updates today, there was a lot to see but at the same time there were a few disappointments for the iPod development community.</p>
<p><strong>iTunes 9</strong></p>
<ul>
<li>Genius feature updated</li>
<li>iTunes LP, this is the new iTunes metadata interaction, it contains lyrics, large images, chronology etc.</li>
<li>Updated artist pages in the iTunes Store</li>
<li>Interactive iPhone/iPod Touch layout editor</li>
</ul>
<p><strong>iPod Touch (no camera)</strong></p>
<ul>
<li>Price dropped, most likely for the coming holiday season</li>
<li>8GB ($199) 32GB ($299) 64GB ($399)</li>
</ul>
<p><strong>iPod Nano</strong></p>
<ul>
<li>New device, this one will contain, get this, a VIDEO CAMERA</li>
<li>Anodized steel models, shipping today</li>
</ul>
<p><strong>iPod Shuffle</strong></p>
<ul>
<li>Price drops for everything, 2GB ($59) 4GB ($79)</li>
<li>Stainless Steel 4GB model for $99</li>
<li>Shipping TODAY</li>
</ul>
<p><strong>iPod Classic</strong></p>
<ul>
<li>Price cuts, starting today</li>
</ul>
<p>Overall, not that much to celebrate, all that is notable is the Nano 5G and iTunes 9, which Jobs stated was just a &#8220;cleaner&#8221; version of iTunes 8 with a few tweaks.</p>
<p>iDevKit</p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/09/apples-rock-and-roll-event/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>September 9th Event</title>
		<link>http://idevkit.com/iphonedev/2009/09/september-9th-event/</link>
		<comments>http://idevkit.com/iphonedev/2009/09/september-9th-event/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 16:56:57 +0000</pubDate>
		<dc:creator>sj</dc:creator>
				<category><![CDATA[Community News]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://idevkit.com/iphonedev/2009/09/september-9th-event/</guid>
		<description><![CDATA[As we all know by now, the rumor is that Apple will be making some big announcements tomorrow. Word is that we may be looking at a new line of iPods, some new iTunes toys including possibly even iTunes 9. There could easily be some big news tomorrow so iDevKit will be posting updates as [...]]]></description>
			<content:encoded><![CDATA[<p>As we all know by now, the rumor is that Apple will be making some big announcements tomorrow. Word is that we may be looking at a new line of iPods, some new iTunes toys including possibly even iTunes 9. There could easily be some big news tomorrow so iDevKit will be posting updates as soon as they are released, stay tuned. I will post more up as I find out exactly what&#8217;s going on.</p>
<p>Regards,<br />
sj</p>
<p>UPDATE: Event info is now available: <a href="http://idevkit.com/iphonedev/index.php?p=77">iDevKit &#8211; Apple&#8217;s Rock and Roll Event</a></p>
]]></content:encoded>
			<wfw:commentRss>http://idevkit.com/iphonedev/2009/09/september-9th-event/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
