Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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
Iphone 如何移除for循环中的设备阻塞_Iphone_Objective C - Fatal编程技术网

Iphone 如何移除for循环中的设备阻塞

Iphone 如何移除for循环中的设备阻塞,iphone,objective-c,Iphone,Objective C,我有一个表格视图,我在叠加视图中显示数据(叠加包含滚动视图,我为每个页面添加了大约30个组件,如标签、文本视图),大约有20页 didSelectRowAtIndexPath中的我的代码 _scrollViewOverlay = [[UIScrollView alloc] initWithFrame:CGRectMake(13, 103, 292, 273)]; _scrollViewOverlay.pagingEnabled = YES; _scrollViewOver

我有一个表格视图,我在叠加视图中显示数据(叠加包含滚动视图,我为每个页面添加了大约30个组件,如标签、文本视图),大约有20页 didSelectRowAtIndexPath中的我的代码

    _scrollViewOverlay = [[UIScrollView alloc] initWithFrame:CGRectMake(13, 103, 292, 273)];
    _scrollViewOverlay.pagingEnabled = YES;
    _scrollViewOverlay.backgroundColor = [UIColor  colorWithRed:10.0f/255.0 green:132.0f/255.0f blue:217.0f/255.0f alpha:1];
    _scrollViewOverlay.delegate=self;
    [_viewOverlay addSubview:_scrollViewOverlay];
    [_scrollViewOverlay release];
    for(int iCount = 0;iCount<[_arrayDeatil count];iCount++)
    {
         //here  i am adding 8 label and 4 textFields to _scrollViewOverlay for each page 
    }
scrollViewOverlay=[[UIScrollView alloc]initWithFrame:CGRectMake(13、103、292、273)];
_scrollViewOverlay.PaginEnabled=是;
_scrollViewOverlay.backgroundColor=[UIColor带红色:10.0f/255.0绿色:132.0f/255.0f蓝色:217.0f/255.0f alpha:1];
_scrollViewOverlay.delegate=self;
[_ViewOverlayAddSubView:_scrollViewOverlay];
[_scrollViewOverlay发布];

对于(int iCount=0;iCount您应该使用与UITableView类似的方法。您只需将屏幕上的内容所需的内容加载到内存中,并可能在屏幕外加载一些内容以便于滚动。您可能还需要实现重用队列,就像在UITableView中一样。

以不同的方式运行这一基本代码行ead而不是UIThread可以是一个快速的解决方案。不是真的,因为下面的代码很可能依赖它。加上这是所有的UI代码,UI代码在大多数情况下都不能在后台运行。它非常复杂。我想说,试一试,然后带着具体的问题回来。@Narayana-事实上,你能使用表视图吗?我见过一些人在o对一个表视图进行旋转,然后对所有单元格进行反向旋转。本质上是给它们一个水平的表视图。