Weird UserDefaults problem
Weird UserDefaults problem
- Subject: Weird UserDefaults problem
- From: Matt Ball <email@hidden>
- Date: Sun, 14 Mar 2004 21:45:56 -0500
When I initially load my App's preferences, I have the following code:
homePage = [[NSUserDefaults standardUserDefaults]
objectForKey:@"HomePageAddress"];
if(homePage == nil)
{
homePage = @"
http://www.apple.com";
}
openNewWindowWithPageType = [[NSUserDefaults standardUserDefaults]
objectForKey:@"OpenWithPageType"];
with homePage and openNewWindowWithPageType both being NSStrings
defined earlier. Later, I call this code:
- (void) goToHomepage
{
if(openNewWindowWithPageType == @"Empty Page")
{
}
else if(openNewWindowWithPageType == @"Bookmarks")
{
[self toggleBookmarksView];
}
else if(openNewWindowWithPageType == @"Home Page")
{
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL
URLWithString:homePage]]];
}
NSLog(@"%@", openNewWindowWithPageType);
}
For some reason, it doesn't work. The NSLog does send Empty Page,
Bookmarks, or Home Page to the console, but for some reason my if
statements do not get called. I've tried putting an NSLog statement
inside each if and else if to see if any of them were getting called,
and they aren't. Does anyone have any idea why this might be happening?
Thanks.
-- Matt Ball
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.