I need to Write 4 sections in a table where two of them have only a single row.
So 开发者_StackOverflow社区is there any other way i could do it instead of using NSArray for just a single row?
You can create two dimensional array using NSMutablearray
You can access them by using
[[array objectAtIndex: ] objectAtIndex: ]
Hope it helps.....
Dont know from where you are getting the data for your 2 single rows but you could make a switch(indexPath.section)/case or an if(indexpath.section == yoursectionnumber) logic in your cellForRowAtIndexPart delegate method and there you can assign a value to your cell.
As DShah wrote, you can use variables and such for this so you could for example do a cell.textLabel.text = myString;
Where myString is an NSString created by you.
精彩评论