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

QRadioElement NSRangeException (fix it by your own code) #739

Open
hqlulu opened this issue Dec 26, 2015 · 0 comments
Open

QRadioElement NSRangeException (fix it by your own code) #739

hqlulu opened this issue Dec 26, 2015 · 0 comments

Comments

@hqlulu
Copy link

hqlulu commented Dec 26, 2015

Xcode 7.1 IOS 9.1

QSection *section1 = [[QSection alloc] initWithTitle:@"Radio element with push"];
QRadioElement *element0 = [[QRadioElement alloc] initWithItems:[NSArray arrayWithObjects:@"Football", @"Soccer", @"Formula 1", nil] selected:0];
[section1 addElement:element0];
[root addSection:section1];

click the row, then got an exception:

QuickDialogTableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (0) beyond bounds (0) for section (0)

fix it by this way:

error code at QuickDialogController.m line 116

- (void)viewWillAppear:(BOOL)animated {
    _viewOnScreen = YES;
    [self.quickDialogTableView deselectRows];
    [super viewWillAppear:animated];
    if (_root!=nil) {
        self.title = _root.title;
        self.navigationItem.title = _root.title;
        if (_root.preselectedElementIndex !=nil)
            [self.quickDialogTableView scrollToRowAtIndexPath:_root.preselectedElementIndex atScrollPosition:UITableViewScrollPositionTop animated:NO];

    }
}

set a controllerName:

QSection *section1 = [[QSection alloc] initWithTitle:@"Radio element with push"];
QRadioElement *element0 = [[QRadioElement alloc] initWithItems:[NSArray arrayWithObjects:@"Football", @"Soccer", @"Formula 1", nil] selected:0];
element0.controllerName = @"ExampleViewController";
[section1 addElement:element0];
[root addSection:section1];

code for ExampleViewController

- (void)viewWillAppear:(BOOL)animated {
    [self.quickDialogTableView reloadData];
    [super viewWillAppear:animated];
}

it can be fixed

@hqlulu hqlulu changed the title QRadioElement NSRangeException QRadioElement NSRangeException (fixed by your own code) Dec 26, 2015
@hqlulu hqlulu changed the title QRadioElement NSRangeException (fixed by your own code) QRadioElement NSRangeException (fix it by your own code) Dec 26, 2015
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

1 participant