how can i equate an NSString to an ObjectForKey (which is also an
NSString)?  kinda driving me crazy.

-=-=-=-
        NSString *desktopPlist =
[@"~/Library/Preferences/com.apple.desktop.plist"
stringByExpandingTildeInPath];
        NSString *originalDesktopBackgroundImage = [[[[NSDictionary
dictionaryWithContentsOfFile: desktopPlist]
objectForKey:@"Background"] objectForKey:@"default"]
objectForKey:@"ImageFilePath"];
        NSLog(originalDesktopBackgroundImage);
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject:originalDesktopBackgroundImage
forKey:@"OriginalBackground"];
        
        NSString *pathy = @"/Library/Desktop Pictures/Nature/Aurora.jpg";
        if ([defaults objectForKey:@"OriginalBackground"] == pathy)
                {
                NSLog(@"Same");
                }
                else
                {
                NSLog(@"Not Same");
                }
-=-=-=-

so i'm getting the path of the current desktop background and setting
it to the defaults.  the current desktop image in the Aurora image.

my IF statement isn't working as i am expecting. the output reads:

-=-=-=-
2009-02-13 01:44:51.911 Test[33576:10b] /Library/Desktop
Pictures/Nature/Aurora.jpg
2009-02-13 01:44:51.913 Test[33576:10b] Not Same
-=-=-=-

but they are the same!  aren't they?!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to