Wednesday, October 16, 2013

tableview use of

I use the program to read sqlite two fields from the data are stored in the NSMutableArray (list and lsdetail)
By
[List addObject: item];
[Lsdetail addObject: tdetail]; added.
Then
cell.textLabel.text = [list objectAtIndex: row];
cell.detailTextLabel.text = [lsdetail objectAtIndex: row];
After execution discovery, tableview shows normal, but can not display detail data (already set the style Subtitle), but if
cell.detailTextLabel.text = [lsdetail objectAtIndex: row]; instead
cell.detailTextLabel.text = [list objectAtIndex: row];

detail can be displayed, what are the reasons, [lsdetail addObject: tdetail] sentence added to it seems empty characters, but can confirm tdetail has data, but add in as lsdetail after the string is empty?
Reply:
tdetail is what stuff?
Corresponding type of description method overrides yet?
Array added before, NSLog output to tdetail first look
 
NSLog (@ "Detail =% @", tdetail);




Reply:
Find a reason, which caused an NSMutableArray not initialized.
Not being given the run, alas If in vs no such troubles.
Reply:
2F reply quote:
find the reasons, which caused an NSMutableArray not initialized.
Not being given the run, alas If in vs no such troubles.


Dynamic languages ​​and static language differences
Reply:
In the development stage to be used for an array or a pointer assertion Yeah, the pro!

No comments:

Post a Comment