Curnelious
Curnelious

Reputation: 1

string /UTF8 problem

i am having some simple problem in objective c maybe you can help .

i have 2 strings that get their value like that :

triger = [NSMutableArray arrayWithObjects:[NSString stringWithFormat: @"%f", x],
                                          [NSString stringWithFormat: @"%f", y],
                                          nil];

X = [triger objectAtIndex:0]; // coordinates
Y = [triger objectAtIndex:1];

NSLog(@"%@", Y);
NSLog(@"%@", X);

if (Y == @"0" && X == @"0") // TOUCH TRIGER

now the NSLog is show me the value y=0 and x=1, AND THE IF STATEMENT IS ALWAYS DONE.. why is that ?? what am i doing wrong ?

thanks . . . . . .

Upvotes: 1

Views: 109

Answers (1)

Joel
Joel

Reputation: 1140

I think you need to change your if statement to this:

if([Y isEqualToString:@"0"] && [X isEqualToString:@"0"]) 

Upvotes: 1

Related Questions