Xcode 取消或结束UIScrollView

Xcode 取消或结束UIScrollView,xcode,uiscrollview,Xcode,Uiscrollview,我编写了一个代码,当按下按钮时调用UIScrollView。问题是,即使按下另一个按钮,它也会保留在屏幕上。我不知道该如何结束或驳回这件事 (iAction)onClickSize:(id)发送方{ viewSizePrint.hidden=YES; scrlView.contentSize=CGSizeMake(1500214); 对于(inti=0;iThanks Aaron。我以前有过那个代码,它抛出了一个异常。下面是它说的int main(intargc,char*argv[]){@au

我编写了一个代码,当按下按钮时调用UIScrollView。问题是,即使按下另一个按钮,它也会保留在屏幕上。我不知道该如何结束或驳回这件事

(iAction)onClickSize:(id)发送方{

viewSizePrint.hidden=YES;
scrlView.contentSize=CGSizeMake(1500214);

对于(inti=0;iThanks Aaron。我以前有过那个代码,它抛出了一个异常。下面是它说的int main(intargc,char*argv[]){@autoreleasepool{return UIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegate class]);}}线程1:SIGABRT
viewSizePrint.hidden = YES;
scrlView.contentSize = CGSizeMake(1500, 214);

for (int i=0; i<20; i++) {
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(158*i+22, 2, 154, 210)];
    imgView.tag = i+10;
    [scrlView addSubview:imgView];

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"layout%d_thumbnail", i+1]] forState:UIControlStateNormal];
    btn.frame = CGRectMake(158*i+30, 10, 138, 194);
    btn.tag = i;
    [btn addTarget:self action:@selector(onClickTheme:) forControlEvents:UIControlEventTouchUpInside];
    [scrlView addSubview:btn];
}

[self refreshTheme:[AppDelegate sharedAppDelegate].shrTheme];

}
[scrlView removeFromSuperview];
scrlView = nil;