How to change UITableViewCell style and insert buttons to UITableView?
Hi, I have a couple of problems.
The first is: how to change UITableViewCell style during UITableView usage. The logic how to use styles in the same table should be:
1. Set UITableViewCellStyleValue2
2. Set UITableView to edit- mode
3. Set UITableViewCellStyleSubtitle
I have try two different identifier to use right cells but it didn't work well or I did it wrong.
The reason why I want to change style during usage is because in table edit- mode I need add images to cells. Images should be kind of buttons where to set my own data properties.
Second question: Is it even possible to set own squares to the same area with cell images?
Third: is it possible insert more than one "real" button to cell (I already have UITableViewCellAccessoryDetailDisclosureButton in use)?
Last edited by Alec; 07-30-2010 at 08:09 AM.
Reason: Fix to second question
cellForRowAtIndexPath is called for every row, putting your code in there creates a leaking NSMutableArray containing more cells than is needed (just 1).
You're also creating cells without a style or reuseIdentifier.
Finally, UIButton doesn't have an initWithType method.
if you are not understand it was only little example, not complete code, that you can paste in your project. So if topic starter have basic programming skills he can correct use this code. Or no?
Now I use only UITableViewCellStyleValue2 style with new UIImageView in normal mode and UIButton in table editing- mode.
There was no problem to use examples so next time I will send my questions to the advanced forum. Thank you for everyone guys.