0

Strange error here.... For this piece of code:

NSXMLNode *root = [[ads_user_defined_manufacturer_model objectAtIndex:i] parent];
NSXMLNode *make = [root childAtIndex:0];

First line returns an error "Unused variable root", second line returns an error "'root' was not declared in this scope..

Any ideas? Thanks.

Kevin
  • 1,469
  • 2
  • 19
  • 28
  • 1
    It's highly likely that the problem is not in those two lines. You may want to start looking for mismatched braces higher up in the function/method. If you are going to need more help than this, please post the entire method, as well as the exact error messages, otherwise it's basically impossible to guess. – gaige May 29 '12 at 11:52

1 Answers1

0

Actually it wasn't, you're right. It was way up in the code.. I had an if statement previous to the code above without any { } . Therefore only the first statement was being done in the if statement, with the other being done outside.

Hence the inability to see the variable decleration.

@gaige If you want to put your response as an answer, I'd be happy to mark it as the answer. Thanks.

Kevin
  • 1,469
  • 2
  • 19
  • 28