Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-27-2009, 12:29 PM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 44
Exclamation How do I check if the text inputed in a UITextField is equal to a different value?

Alright, in my App when it is started the User picks a 4 digit password. This password is then saved into the Settings.bundle. Later I call NSString *textValue = to whatever is in the Settings.bundle. That works fine. In the app if a specific button is pressed another UItextfield is brought up asking for the user to enter then same password as set before. I just don't know how I would form an "if" statement that would check if the current textField equals the textValue.


I tried

if (passwordTextField.text = textValue) {

}

and also tried

if (passwordTextField.text == textvalue {

}

both did not work. I need a statement that is check if whatever the user submits in the passwordTextField equals the textValue string.
shabzcohelp is offline   Reply With Quote
Old 07-27-2009, 12:42 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 59
Default

try isEqualToString.

ie:

Code:
[passwordTextField.text  isEqualToString:textValue]
Where textValue is a valid NSString object

Quote:
Originally Posted by shabzcohelp View Post
Alright, in my App when it is started the User picks a 4 digit password. This password is then saved into the Settings.bundle. Later I call NSString *textValue = to whatever is in the Settings.bundle. That works fine. In the app if a specific button is pressed another UItextfield is brought up asking for the user to enter then same password as set before. I just don't know how I would form an "if" statement that would check if the current textField equals the textValue.


I tried

if (passwordTextField.text = textValue) {

}

and also tried

if (passwordTextField.text == textvalue {

}

both did not work. I need a statement that is check if whatever the user submits in the passwordTextField equals the textValue string.
__________________
"The attraction of knowledge would be small if one did not have to overcome so much shame on the way" - iNietzsche iPhone App
iphonatic is offline   Reply With Quote
Old 07-27-2009, 12:49 PM   #3 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 44
Default Solved!

Ah! Thank you so much. Worked wonderfully.
You're a genius, I'm not sure why I didn't think of that.

Quote:
Originally Posted by iphonatic View Post
try isEqualToString.

ie:

Code:
[passwordTextField.text  isEqualToString:textValue]
Where textValue is a valid NSString object
shabzcohelp is offline   Reply With Quote
Old 07-27-2009, 12:53 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 59
Default

Glad I could help,

I'm still new, but I think that helps as it's all fresh in my mind

You can click on the badge icon near my username to bump up my reputation if you like I'll try and help as many people as I can, and contribute the things I'm learning as I go along...

Quote:
Originally Posted by shabzcohelp View Post
Ah! Thank you so much. Worked wonderfully.
You're a genius, I'm not sure why I didn't think of that.
__________________
"The attraction of knowledge would be small if one did not have to overcome so much shame on the way" - iNietzsche iPhone App
iphonatic is offline   Reply With Quote
Reply

Bookmarks

Tags
settings.bundle, uitextfield

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 278
25 members and 253 guests
ADY, AragornSG, Bertrand21, Dani77, Dattee, fkmtc, HDshot, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, jimbo, macquitzon216, mer10, NSeven, prchn4christ, Rudy, sacha1996, silverwiz, sneaky, spiderguy84, Sunny46, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:06 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0