Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIPickerView设置int变量_Ios_Variables_Uipickerview - Fatal编程技术网

Ios UIPickerView设置int变量

Ios UIPickerView设置int变量,ios,variables,uipickerview,Ios,Variables,Uipickerview,这是我的Xcode项目的.m文件。有人能告诉我,是否有一种方法可以使用UIpickerView或任何其他方法,以便在运行应用程序时,我可以将“5”更改为不同的数字,以增加每秒的帧数。求求你,我已经看过了,到处都没有答案 ----UIPICKERVIEW代码-- ----------框架----- 问题标题包含答案:创建一个使用UIPickerView设置的int变量。您找不到任何编写UIPickerView anywhere的示例?无论何时,只要不放置数字而不是5,Xcode都会显示错误。我试

这是我的Xcode项目的.m文件。有人能告诉我,是否有一种方法可以使用UIpickerView或任何其他方法,以便在运行应用程序时,我可以将“5”更改为不同的数字,以增加每秒的帧数。求求你,我已经看过了,到处都没有答案

----UIPICKERVIEW代码--


----------框架-----


问题标题包含答案:创建一个使用UIPickerView设置的int变量。您找不到任何编写UIPickerView anywhere的示例?无论何时,只要不放置数字而不是5,Xcode都会显示错误。我试着做一些类似int=a的事情;但是每当我用a而不是5时,它都会给我一个错误编辑你的问题,显示你尝试过的确切代码,给出你得到的确切错误,以及它在哪一行给出错误。我不知道怎么做,这就是我问这个问题的原因。我是Xcode新手。我让UIpickerView在标签中显示它的编号,但我不知道如何从中创建变量,并将其替换为5。我是否仍应显示我为其设置的任何其他代码?是的,显示您尝试过的代码并给出您得到的确切错误,否则问题可能会以“不清楚您在问什么”结束。只是不要发布太多的代码。把范围缩小到相关部分。
- (BOOL)setupAVCapture
{
 NSError *error = nil;

frameDuration = CMTimeMakeWithSeconds(1./5., 90000);

AVCaptureSession *session = [AVCaptureSession new];
[session setSessionPreset:AVCaptureSessionPresetHigh];
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, pickerView.frame.size.width, 33)];
    label.backgroundColor = [UIColor clearColor];
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont fontWithName:@"HelveticaNeue-bold" size:36];
    label.text = [NSString stringWithFormat:@"  %ld", row+1];
    return label;
}

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

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

-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
    return [_list objectAtIndex:row];

}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
    NSString *string = [NSString stringWithFormat:@"Fps:%@", [_list objectAtIndex:row]];
    _pickerLabel.text = string;
}
-(void)Viewdidload

 _list = [[NSMutableArray alloc] init];
    [_list addObject:@"  1"];
    [_list addObject:@"  2"];
    [_list addObject:@"  3"];
    [_list addObject:@"  4"];
    [_list addObject:@"  5"];
    [_list addObject:@"  6"];
    [_list addObject:@"  7"];
    [_list addObject:@"  8"];
    [_list addObject:@"  9"];
NSError *error = nil;

    frameDuration = CMTimeMakeWithSeconds(1./5., 90000);