开发者

NSTableView rows using NSArray

开发者 https://www.devze.com 2023-03-30 21:56 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消