views:

149

answers:

2

I have this code:

NSLog([url path]);
if([url path] == @"/connect/login_success.html") {
    NSLog("IT WORKZ");
}

When I run my application, do the login etc... my console says:

2010-05-04 23:49:57.297 Framebook Test Application[8069:a0f] /connect/login_success.html

But it should also print IT WORKZ to the console, which it does not.

Can anyone help me? Thanks.

+4  A: 

To compare strings, you use isEqualToString:. == tests pointer equality.

Chuck
+1  A: 

try this:

if([[url path] isEqualToString:@"/connect/login_success.html"]) {
    NSLog("IT WORKZ");
}
Mihir Mathuria
Mmm... I think you forgot a `:`
Time Machine
fixed...thanks!!
Mihir Mathuria