-1

I am developing one application. In my application I want to develop log in page using a plist. My requirement is when user enters username and password they go to next view.

How do I create a log in page?

I am new to the programming. Please send me any tutorial or sample code.

Thanks in advance

Popeye
  • 11,839
  • 9
  • 58
  • 91
user2439185
  • 1
  • 1
  • 2
  • check this [Tutorial](http://www.theappcodeblog.com/2011/05/30/property-list-tutorial-using-plist-to-store-user-data/) – Mudit Bajpai Jun 05 '13 at 12:02
  • I would suggest you to use Keychain. Its explained in this [post][1] [1]: http://stackoverflow.com/a/6972305/1029360 – Adithya Jun 05 '13 at 12:08
  • Why would you use a `plist`? Do you know what a `plist` is? – Popeye Jun 05 '13 at 12:11
  • Have you tried anything? Such as a simple google search. If so please provide us with what you have looked at or code that you have been playing with, otherwise we could just be sending you back to what you have already looked at. This question shows as it is no research, questions with no research shown are not very good questions. Help use help you. – Popeye Jun 05 '13 at 12:19

1 Answers1

2

I don't know why you are try to use plist for that. You can (and should) use NSUserDefaults (this is also plist but easy to manage).

Try to save data:

  [[NSUserDefaults standardUserDefaults] setObject:@"myName" forKey:@"userName"];

and later get:

  [[NSUserDefaults standardUserDefaults] stringForKey:@"userName"];

Of course i probably don't have to tell you that storing password in plain text is a very bad idea in general.

Jakub
  • 13,712
  • 17
  • 82
  • 139
  • 1
    Whilst this is correct +1, it would be more secure to use keychain instead of `NSUserDefaults` to store username and password. Actually if I was telling someone how to create a log in page that stored a users username and password I would tell them to stay clear of `NSUserDefaults` due to it not being secure, but like I say this answer is still correct based on users question. – Popeye Jun 05 '13 at 12:14
  • I totally agree! That's why i bold key words in my last sentence. – Jakub Jun 05 '13 at 12:29