At VTM 2010
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
Voices That Matter – iPhone Developer Conferance

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 & 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 Erica Sadun is the technical chair this year, so you know, come.
Straight from the horses mouth:
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.
At this unique event, you will:
• Learn the skills needed to build, test, and distribute successful iPhone and iPad applications
• Choose the session topics you need to become an iPhone and iPad development master
• Network with developers equally as passionate about this exciting platform and where it’s going
• Leverage your existing skills in a new and profitable way
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!
Time for Apple’s “Latest Creation”!
In just over one hour we will finally get to see what Apple’s “Latest Creation” 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 are looking at 9.7″ 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 VERIZON 3G UPDATE: WSJ today announced that AT&T will be the sole carrier of the iPad. Pictures curtousy of Gizmodo and Gdgt:
WE WILL BE POSTING TUTORIALS IN THE COMING DAYS FOR DEVELOPERS!
Late late late on updates…
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…”advanced”…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.
Regards,
Sj
New iMac, MacMini, Magic Mouse, and Updated MacBook
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″ and 27″ 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.
-The processing speed for the new line has also been drastically increased. We are looking at Core 2 Duo’s up to 3.33GHz for the 21.5″ models and Quad-Core’s of 2.66GHz (Core i5) and 2.8GHz (Core i7) for the 27″ model.
-Graphic cards have also been upgraded to 256MB ATI Radeon HD 4670 for the 21.5″ and a 512MB ATI Radeon HD 4850 for the 27″.
-From a memory stand point, the iMac now supports up to 16GB of RAM and an HDD of up to 2TB.

Magic Mouse:
-This is the latest mouse out of Cupertino and it is coming with a serious overhaul, we are talking about multitouch capabilities.
-It supports standard clicking, right-clicking, 360 degree scrolling on the surface along with screen zooming.

Mac Mini:
-The updates to this little guy start at the processing speed, which has been pushed up to a Core 2 Duo 2.53GHz processor.
-The Mini now allows for up to 4GB of RAM and a 500GB HDD.
-Graphics have also been upgraded, now shipping with an NVIDIA GeForce 9400M card.

MacBook:
-A new unibody design (similar to the Pros) is now used, no other major upgrades have been mentioned.

(most images courtesy of APPLE)
blackra1n
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’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!
**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.
Regards,
sj
Saving NSMutableArrays
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. Create and NSMutableArray with your object -> Locate the directory and the file to save to -> Encode the array into an NSMutableData file -> Store the NSMD in the given directory Simple enough. For loading, its really the same system just backward I guess you could say. We’ll go into that a little bit later. For now, Open Xcode -> New Project -> “View Based Application” -> “New File” -> “Objective-C Class” -> Call it theFile and check the box for a header file. 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 NSStrings along with their @property/@synthesize declarations at the end of the header and start of the @implementation. This is the object that we are going to toss into our NSSMutableArray 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 NSStrings textField and numberField (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’t mentioned before). We will need to implement both the encoder and decoder methods here and thats it. Add the following code to the implementation of theFile:
- (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];
}
First off is the encode protocol, all we are doing here is encoding the two strings inside of the theFile 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 UITextFields to control the content of the strings in our custom object, two UIButtons to save and load the data, and a UILabel to display the loaded contents. Same thing as we did in our previous tutorial that introduced our world of iDevKit to the UITextField, UILabel, and UIButton, which can be found here. 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 UITextFields to the header of your viewController class (labelField, numberFieldUIButtons (saveItems, loadItemstheFile *value;.
- (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;
}
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 NOTHING NEW. Alrighty then, notice that the UIButtons send us to two separate methods: saveObjects and loadObjects. Let us start with saving:
-(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];
}
Okay then… First three lines are going to allocate/initialize an instance of theFile and set both of the strings inside of it to the values set in our UITextFields. After that, we create an NSMutableArray and store value inside of it, where nil denotes the end of the array. We then create a data file that will later house our array, we use NSMutableData for this. Then we declare an NSKeyedArchiver 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 fileNSLog() 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 data to our file, clean memory, and we are saved! Almost done, now to add in our decoder bit, add our loadObjects method and lets begin.
-(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");
}
}
First up is we create what is called an NSFileManager and we set the value of this instance to defaultManager; 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’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 if-else statement that uses our manager to check to see if our file located at file 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’t learn anything. To start with we will declare the same variables we did while saving, with exception to the NSKeyedArchiver, which we replaced with the inverse: NSKeyedUnarchiver. We also put in an NSString to store the displayed string in later. The next line checks to see whether or not we have already allocated value, and if not, then we allocate it, simple ’nuff. We now pull the NSMutableData file from our Documents directory that we proved existed, and store it in data. We decode the data file from there using our unarchiver and search for an NSMutableArray inside it using the key that we archived with before. We push the decoder along while we store the array in array, clean the memory a little, and pull the first value from the array and store it in value. From here is all cosmetic, we take the two strings in our new object, combine them, and set the UILabel text to it.

Thats about it, if you have any questions just ask, you can find the source code here.


Regards,
Sj
UITextFields and UIButtons
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.
Navigate to TextInputViewController.h and you will need to declare the UITextFieldDelegate protocol by adding <UITextFieldDelegate> after TextInputViewController : UIViewController, 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:
UILabel *firstLbl; UILabel *lastLbl; UITextField *firstName; UITextField *lastName; UIButton *saveBtn; UIButton *loadBtn;,
Under that, make sure to add the following code outside of the brackets but before the @end, this will let you control the UIButtons and UITextFields:
@property(nonatomic,retain) UITextField *firstName; @property(nonatomic,retain) UITextField *lastName; @property(nonatomic,retain) UIButton *saveBtn; @property(nonatomic,retain) UIButton *loadBtn;
Now, go to your TextInputViewController.m and uncomment the loadView method. Create a UIView now to fit the frame of the screen and set it to the self.view:
CGRect frame = [UIScreen mainScreen].applicationFrame; UIView *view = [[UIView alloc] initWithFrame:frame]; self.view = view;
NOTE: This is the last time I will be explaining how to create the viewController’s main view, same goes with generic labels that we will be using a lot, which will follow
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:
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];
This is simple, we are preparing the UILabels for the loaded data that we will be accessing later. I didn’t bother setting any other properties for these labels, this isn’t a UILabel tutorial, I covered more of that in the Hello World tutorial 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:
- (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;
}
Alright, there are a LOT 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 if statement that checks to see if the text field has already been allocated and initialized, if the firstName returns a nil value, then the enclosed statements are executed, if it doesn’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 UIKit objects, you need to set the text field inside of a frame using the CGRectMake method. We initialize firstName with this frame. Then we set the borderStyle, this is what the frame of the field will look like, I used the UITextBorderStyleRoundedRect style here, which, like it says, makes the frame rounded on the corners. textColor sets the input text’s color and font sets the font size of that input, similar to that used in a UILabel. We use placeholder to fill the UITextField with a background text until it is touched and/or has any input. autocorrectionType sets whether or not to use the iPhone’s auto-correct dictionary with input, I set this to no for proof and practice, the default is YES. The keyboardType and returnKeyType properties delegate the keyboard settings, the first sets it to the standard keyboard and the latter sets the return key to say Done and to dismiss the keyboard. Almost done, clearButtonMode property tells us whether or not to use the little gray ‘X’ that clears the field. Finally, delegate tells the text field that it is being controlled by this particular view controller. We return the UITextField now at the end.
We use this method form again for the lastName, replacing firstName with lastName and changing any properties based on what you want to play with. Remember, hit Esc on your keyboard to list the available options for each property after the ‘=’ sign.
Add the following code to dismiss the keyboard when Done is clicked:
- (BOOL) textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
Now we need to start setting up the buttons that save and load the data:
- (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;
}
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 UIButtonTypeRoundedRect and retain the view. Next is the frame 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’s titles and images etc are based off of the UIControlState of the button. First, we set the title of the button at its UIControlStateNormal, in this case it just says “Save”; we use the same statement again below, except using UIControlStateHighlighted, this sets the title of the button when it is clicked down. We set the titleColor now for both states to a custom UIColor value, followed by the backgroundColor property, which makes the outside of the frame meld with the background’s color or image. Finally, the most important bit of code is the addTarget:action:forControlEvents: that tells the program to execute the method saveText inside of self when the user performs a UIControlEventTouchUpInside, aka a touch of the button. We return the button and continue.
Do this again with loadBtn, only this time make sure to change that second to last line to:
[loadBtn addTarget:self action:@selector(loadText) forControlEvents:UIControlEventTouchUpInside];
Configure it how ever you wish and play around with the properties, the best way to learn how to program is trial by error.
Now before we put this all together in our loadView method, we have two more bits of code to write, and these will be the ones the let us save and load our data: saveText and loadText. Let us start with the first one, insert the following code after the UITextField and UIButton methods:
[[NSUserDefaults standardUserDefaults] setObject:firstName.text forKey:@"firstName"]; [[NSUserDefaults standardUserDefaults] setObject:lastName.text forKey:@"lastName"]; [[NSUserDefaults standardUserDefaults] synchronize]; firstName.text = @""; lastName.text = @"";
Alright, new concept here: NSUserDefaults. 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 standarUserdefaults 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 setObject: and then the string, which is the text 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 forKey: to the name of the variable. NOTE: I usually do it this way as an organizational method but you can set the forKey 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. Last new bit of code here is the synchronize 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.
Okay, almost done… now we just need to tell the program just how to load the data that we previously saved. Add:
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];
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 standardUserDefaults, then we tell it to load the object that has a matching key to the one we put after objectForKey, 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. NOTE: I am relatively sure that you can use stringForKey: instead although I have never had a reason to so play with it as you will. 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 loadView method, insert:
[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];
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 release everything that you retained in the dealloc method, Build & Go.

I changed the background color the same way we did in Hello World
That is all for now, you can get the sample code here.
Regards,
sj
Apple’s Rock and Roll Event
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 iPhone/iPod Touch layout editor
iPod Touch (no camera)
- Price dropped, most likely for the coming holiday season
- 8GB ($199) 32GB ($299) 64GB ($399)
iPod Nano
- New device, this one will contain, get this, a VIDEO CAMERA
- Anodized steel models, shipping today
iPod Shuffle
- Price drops for everything, 2GB ($59) 4GB ($79)
- Stainless Steel 4GB model for $99
- Shipping TODAY
iPod Classic
- Price cuts, starting today
Overall, not that much to celebrate, all that is notable is the Nano 5G and iTunes 9, which Jobs stated was just a “cleaner” version of iTunes 8 with a few tweaks.
iDevKit
September 9th Event
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’s going on.
Regards,
sj
UPDATE: Event info is now available: iDevKit – Apple’s Rock and Roll Event





