Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Making Improvements To Self Destructing App

I have completed the tutorial for creating your own self destructing app and the second part of designing it as well.

I still want to learn more though. Somethings improvements that I want to add are:

  1. When you log in, if it is capitalized or not matters to how you signed up with your username. How do I get rid of this so it doesn't matter if it is capitalized or not?

  2. Valid email address. How can I make sure users are actually using a valid email address?

  3. Friends. I don't like how you can see all the people in the friends edit tab. How can I make it so you have to search for a user, if it comes up, you can add them that way?

Thank you in advance for your help.

3 Answers

Stone Preston
Stone Preston
42,016 Points

1)simply convert the text entered in the username field (for both login and signup) to all lowercase before sending the data to parse using

    NSString *username =  [usernameField.text lowercaseString]; 

2) the parse signup method checks for email validity automatically (by that I mean some text followed by an @ followed by a .net, .com, etc.). If its not a valid format, it returns an error which you can handle yourself

3) see my reply to this post about searching for a user to add as a friend instead

  1. Should I be removing lines in this code to add the one you gave?

(IBAction)login:(id)sender { NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

  1. Ah thank you for that information!

  2. Just what I need thank you!

  1. Should I be removing lines in this code to add the one you gave?
  • (IBAction)login:(id)sender { NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
  1. Ah thank you for that information!

  2. Just what I need thank you!

Did you get it to work. Please post code. Karma is watching the webb :_)