All About Me… an iPhone App

i just finished my second iPhone app. This app is way more sophisticated then the last one i wrote. It took me almost a week to figure things out and get them working. I think that the biggest problem I have is converting numbers to strings and using member functions. Read the specs for the app. Basically, when you enter a number in the GPA textField the app should update the slider. The problem with this is that the textField value is a string and the slider setValue method only accepts Floats. Let me tell you that this took me soooo long to figure out. This is what you need to do:

//make a sting and set it to the value of the textField
 NSString *text = [[NSString alloc] initWithFormat:@"%@",[txt_gpa text]];
//convert the string to a float        
 float val = [text floatValue];
//set the value of the slider
 [sl_gpa setValue:val animated:YES];
//deallocate the value
 [text release];

I also figured out that to dismiss the keyboard you have to implement:

– (BOOL)textFieldShouldReturn:(UITextField *)theTextField {…}

Here is a screen shot of my app:

You can download the source from here.

View all of my posts on Apple

View all of my posts

 
  
Advertisements

2 thoughts on “All About Me… an iPhone App

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s