ios - UISwitch in a UITableView cell in editing mode -


i followed uiswitch in uitableview cell put uiswitch inside tableview. here code:

uiswitch *myswitch = [[uiswitch alloc] init]; cell.accessoryview = myswitch; 

but problem when put table editing mode:

self.tableview.editing = yes; 

the uiswitch dissapears.

do know how can go around issue?

add uiswitch contentview of cell.

the contentview of uitableviewcell object default superview content displayed cell. if want customize cells adding additional views, should add them contentview positioned appropriately cell transitions , out of editing mode.

[[cell contentview] addsubview:switch]; 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -