escoz / QuickDialog

QuickDialog - Quick and easy dialog screens for iOS
http://escoz.com/open-source/quickdialog
Other
3.07k stars 637 forks source link

QRadioElement, "selected=-1", will get EXC_BAD_ACCESS #713

Closed kongwei closed 9 years ago

kongwei commented 9 years ago

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]; }

kongwei commented 9 years ago

nobody?