When radio list is empty, and set "seleted = -1", we will get EXC_BAD_ACCESS.
In function "setSelected"
self.preselectedElementIndex = [NSIndexPath indexPathForRow:_selected inSection:0];
Then preselectedElementIndex will get a error pointer.
So:
if (_selected >= 0 && _selected <_items.count){
self.preselectedElementIndex = [NSIndexPath indexPathForRow:_selected inSection:0];
}
When radio list is empty, and set "seleted = -1", we will get EXC_BAD_ACCESS.
In function "setSelected" self.preselectedElementIndex = [NSIndexPath indexPathForRow:_selected inSection:0]; Then preselectedElementIndex will get a error pointer.
So: if (_selected >= 0 && _selected <_items.count){ self.preselectedElementIndex = [NSIndexPath indexPathForRow:_selected inSection:0]; }