Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-REPickerItem crash when used in same section #230

Open
esrever10 opened this issue Jun 9, 2015 · 3 comments
Open

Multi-REPickerItem crash when used in same section #230

esrever10 opened this issue Jun 9, 2015 · 3 comments

Comments

@esrever10
Copy link

I use two instance of REPickerItem in same sction of the tableView, if one of the item has just one column, another item has above one column, it will crash when I click the two item back and forth.
The code like this:

self.pickerItem1 = [REPickerItem itemWithTitle:@"Picker"
                                            value:@[@"Item 12", @"Item 23"]
                                      placeholder:nil
                                          options:@[@[@"Item 11", @"Item 12", @"Item 13"], @[@"Item 21", @"Item 22", @"Item 23", @"Item 24"]]];

self.pickerItem2 = [REPickerItem itemWithTitle:@"Picker"
                                             value:@[@"Item 12"]
                                       placeholder:nil
                                           options:@[@[@"Item 11", @"Item 12", @"Item 13"]]];
[section addItem:self.pickerItem1];
[section addItem:self.pickerItem2];

the log like this:

2015-06-09 15:29:48.491 RETableViewManagerExample[5237:218407] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(
    0   CoreFoundation                      0x01d55746 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x019dea97 objc_exception_throw + 44
    2   CoreFoundation                      0x01c29b73 -[__NSArrayM objectAtIndex:] + 243
    3   UIKit                               0x00173139 -[UIPickerView _selectRow:inComponent:animated:notify:] + 120
    4   UIKit                               0x001731f8 -[UIPickerView selectRow:inComponent:animated:] + 65
    5   RETableViewManagerExample           0x00072402 __45-[RETableViewInlinePickerCell cellWillAppear]_block_invoke + 1026
    6   CoreFoundation                      0x01c8e96f __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 63
    7   CoreFoundation                      0x01c8e89c -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 268
    8   CoreFoundation                      0x01c791e5 -[NSArray enumerateObjectsUsingBlock:] + 53
    9   RETableViewManagerExample           0x00071f11 -[RETableViewInlinePickerCell cellWillAppear] + 305
    10  RETableViewManagerExample           0x00079eb3 -[RETableViewManager tableView:cellForRowAtIndexPath:] + 2067
    11  UIKit                               0x002b673d -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 473
@esrever10 esrever10 changed the title Multi-REPickerItem crash when used Multi-REPickerItem crash when used in same section Jun 9, 2015
@thankmelater23
Copy link

Hye im unable to use the pickerview in swift. Can anyone else who used this pod in swift please help. It's the last thing i need to finish my project. If i enter an array into the options and value it crashes when selected. PLEASE HELP!

@lhr000lhr
Copy link

is this bug fixed now?

@aasatt
Copy link

aasatt commented May 25, 2016

@lhr000lhr looks like it still hasn't been addressed. I have some time so I'm going to fork it and see if I can find a solution.

Edit: got it to work in swift formatting my options like:
let options : [AnyObject]! = [ ["Male", "Female"] ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants