I have a problem with uiswitch in my UITableViewCell
that whenever i change a switch value in a specific cell that belongs to a specific section. All other sections
You have two main problems:
This code is wrong:
[cell addSubview:switchController ];
Never add a subview to the cell; add it only to the cell's contentView
.
You are adding the switch every time through cellForRowAtIndexPath:
. But these cells are being reused. So some cells already have the switch. Thus you are adding many switches to some cells.