Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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-04-2009, 04:09 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 8
Default Settings.bundle checking error...really annoying

Hey guys,

I have a settings.bundle that has a Multi Value Specifier that is working properly, I get the setting's value and all but when checking for the string's value it messes up.

For example, if I load the setting's value and display it in an Alert View, it shows the correct value. However, if I check for the setting's value in an if statement, it doesn't work. Here's some example code

Code:
NSString *selectedCarType = [[NSUserDefaults standardUserDefaults] stringForKey:@"default_car"];

/* This displays the correct value and everything ! */
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Setting Value"
message: selectedCarType
delegate:self cancelButtonTitle:@"Ok, Close"
otherButtonTitles:nil];
[alert show];
[alert release];

/* This doesn't work for some reason */
if(selectedCarType == @"All") {
  [listofCars addObject:sportcarDictionary];
  [listofCars addObject:suvcarDictionary];
  [listofCars addObject:vancarDictionary];
} else if(selectedCarType == @"Sport") {
  [listofCars addObject:sportcarDictionary];
}
If I set the selectedCarType to "All" without checking for the settings value, the if statement works. Any help would be nice, thanks!
Raphy is offline   Reply With Quote
Reply

Bookmarks

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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,124
Threads: 38,889
Posts: 170,606
Top Poster: smasher (2,565)
Welcome to our newest member, silveras
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:19 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0