UIPicker和UIActionsheet不再适用于iOS7

Dev*_*evC 0 uipickerview ios ios7

嗨我的UI Picker不再适用于iOS7,它弹出但它是空白的.只发生在iOS7上.

//picker
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
animationsLabel.text = [optionsArray objectAtIndex:[picker selectedRowInComponent:0]];

if (pickerView==animationsPicker) {
    animationsLabel.text = [optionsArray objectAtIndex:[animationsPicker selectedRowInComponent:0]];
}

}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    return 1;
}

-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return [optionsArray count];
}

-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
   return [optionsArray objectAtIndex:row];
   NSLog(@"title options array %lu",(unsigned long)optionsArray.count);
}
Run Code Online (Sandbox Code Playgroud)

行动:

-(IBAction)animationActionSheet:(id)sender {

UIActionSheet *selectPopup = [[UIActionSheet alloc] initWithTitle:@"\n\n\n\n\n\n\n\n"
                                                        delegate:nil
                                               cancelButtonTitle:nil
                                          destructiveButtonTitle:nil
                                               otherButtonTitles:nil];

[selectPopup showInView:self.view];

optionsArray = [[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"6",@"5",@"7",@"8",@"9", nil];

// Create picker
animationsPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(10, 160, 320, 100)];
animationsPicker.showsSelectionIndicator = YES;
[self.view addSubview:animationsPicker];
animationsPicker.delegate = self;
animationsPicker.dataSource = self;
[selectPopup addSubview:animationsPicker];

// Animate picker opening
[UIView beginAnimations:nil context:nil];
[selectPopup setBounds:CGRectMake(0, 0, 320, 485)];
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud)

这是我到目前为止所尝试的.以前在Action表中显示选择器从来没有问题,但现在它是空白的.我想知道其他人是否遇到过这个问题,或者你能看到任何错误吗?我打印了与拾取器有关的一切.

小智 5

我被告知在采取行动表中拣选者是非标准的.我在iOS 6中从未遇到任何问题,但在iOS 7中,我遇到了错误.我切换到UIView而不是我的选择器的动作表,它工作正常.我希望这有帮助.