Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UIPickerView *picker = [[[UIPickerView alloc] init] retain];
- [picker sizeToFit];
- picker.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
- picker.delegate = self;
- picker.dataSource = self;
- picker.showsSelectionIndicator = YES;
- - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
- if (component == 0) return [array1 count];
- if (component == 1) {
- NSLog(@"selectedRowInComponent:%i",[pickerView selectedRowInComponent:1]); //CRASHES HERE
- return [[array2 objectAtIndex:[pickerView selectedRowInComponent:1]] count];
- }
- }
- *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement