ios - How to resize the UITableView row height in Objective C -
in app have requirement saving data in itemsarray in following format like
iphone ipad ipod touch
and same data tryin display in uitableview
but taking first item i.e iphone
it not displaying remaining items in itemsarray.
i have been trying not able find solution it.
can please me solve this.
i new objective c.
thanks in advance.
if want 3 items in single cell create 1 dictionary follows:
nsmutablearray * contentsarray = [nsmutablearray array]; nsmutabledictionary * allcontacts = [nsmutabledictionary dictionary]; for(int = 0; < youritemarraycount; i++) { [allcontacts setobject:[youritemarray objectatindex:i] forkey:@"key %@",[[youtitemarray objectatindex:i] stringvalue]]; } [contentsarray addobject:allcontacts];
then in following method
-(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ //write dictionary logic here nsdictionary *dict = [contentsarray objectatindex:indexpath.row]; //necessary logic go here. }
add following method in code
- (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { return 60; //you can set height of cell here. }
Comments
Post a Comment