Skip to content

Instantly share code, notes, and snippets.

@mmower
Created October 5, 2008 13:24
Show Gist options
  • Select an option

  • Save mmower/14886 to your computer and use it in GitHub Desktop.

Select an option

Save mmower/14886 to your computer and use it in GitHub Desktop.
nodes = [_representation_ nodesForXPath:@"cells/cell" error:nil];
for( NSXMLNode *node in nodes ) {
NSXMLElement *element = (NSXMLElement *)node;
NSXMLNode *attributeNode;
attributeNode = [element attributeForName:@"col"];
int col = [[attributeNode stringValue] intValue];
attributeNode = [element attributeForName:@"row"];
int row = [[attributeNode stringValue] intValue];
ELHex *hex = [self hexAtColumn:col row:row];
[hex initWithXmlRepresentation:element parent:self player:_player_];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment