Hi guys Im trying to read a data block from a TMX file in the following format
<layer name="tiles" width="224" height="20">
<data encoding="csv">
0,0,0,0,0,1,0,4,0,0,0,0,0,0,0
</data>
</layer>
i want to use sparrows block parser method as used in the method
- (void)parseAtlasXml:(NSString *)relativePath
BOOL success = [parser parseElementsWithBlock:^(NSString *elementName, NSDictionary *attributes)
{
As this is neater and easier to get my head around than using the established delegate method of parsing the tmx file, which currently uses found characters delegate to access
the 0,0,0,0,0,1,0,4,0,0,0,0,0,0,0 data
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
if([currentElementName isEqualToString:@"data"] && string.length > 0)
{
((TMXLayer*)[self.layers objectForKey:currentLayerName]).data.data = [[[NSString alloc]initWithString:string]autorelease];
}
}
Is this possible to access the 0,0,0,0,0,1,0,4,0,0,0,0,0,0,0 data with the parseElementsWithBlock block method and if so how can I do this thanks in advance 🙂