-2
NSLog(@"Status: %@", [[[xmlElement elementsForName:@"status"] objectAtIndex:0] stringValue]);
NSString *val = [[[xmlElement elementsForName:@"status"] objectAtIndex:0] stringValue];
NSLog(@"Status: %@", val);

the log shows 2011-07-02 16:06:45.014 Revistero[949:207] Status: error 2011-07-02 16:06:45.014 Revistero[949:207] Status: error

However this doesn't work if (val == @"error") Any suggestion?

Bernardo
  • 475
  • 1
  • 5
  • 19
  • Please don't change answered questions to ask new questions. Accept the answer, then ask a new question separately. – Jim Jul 02 '11 at 21:33
  • You changed the question. Not cool. Just to be clear... you actually implemented Jim's answer in your code above and then tried to turn this into a new question. (Which isn't clear BTW.) – Richard Brightwell Jul 02 '11 at 21:34

1 Answers1

1

%s is the format specifier for plain old C strings. NSStrings are Objective C objects, you can use the %@ format specifier to log them.

Jim
  • 72,985
  • 14
  • 101
  • 108