Hello everybody,
I've got a tableview. In the "ViewDidLoad" method I have filled an array with CXMLElements. On debugging, I have seen that these are all CXMLNodes.
CXMLElement has a property to get the subelements which is called "elementsForName".
In the "cellForRowAtIndexPath:" method I used this property:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
NSString *cellValue = [[[[self.tableDataSource objectAtIndex:indexPath.row] elementsForName:@"text"] objectAtIndex:0] stringValue];
[[cell textLabel] setText:cellValue];
...
}
It worked fine! But in the "didSelectRowAtIndexPath:" method I also want to use this property which damages my App:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
...
NSString *cellValue = [[[[self.tableDataSource objectAtIndex:indexPath.row] elementsForName:@"text"] objectAtIndex:0] stringValue];
NSLog(@"TEST: %@",cellValue);
...
}
There is no warning from the compiler. On selecting a row, the app breaks down.
I need your help.
Thanks