创建动态按钮,但是一旦我点击第一个按钮就会崩溃
-(void)dynamicclick:(id)selector
{
UIButton *btn = (UIButton *)selector;
btn_tag=(int)btn.tag;
optionButton = (QBFlatButton *)[self.view viewWithTag:btn_tag];
optionButton.faceColor = [UIColor colorWithRed:147/255.0 green:192/255.0 blue:31/255.0 alpha:1.0];
NSLog(@"This is the button with tag: %d", btn_tag);
[self performSelector:@selector(goMethod:) withObject:nil afterDelay:0.5];
isOptionSelected = YES;
}
-(void)goMethod:(id)selector
{
if(presentquestion>=AllQuestions.count -1)
{
//NSLog(@"---Limit---");
SummaryVC *summaryVC = [[SummaryVC alloc]init];
[self.navigationController pushViewController:summaryVC animated:YES];
}
else{
[self go];
}
}