application Crash when assign multiple argu fun to dynamic button
Posted
by
AJPatel
on Stack Overflow
See other posts from Stack Overflow
or by AJPatel
Published on 2010-11-23T09:04:27Z
Indexed on
2012/12/05
5:04 UTC
Read the original article
Hit count: 160
for (int i=0;i<[tableDataSource count];i++)
{
NSDictionary *dict = [tableDataSource objectAtIndex:i];
rowText = [dict objectForKey:@"title"];
UIButton *btn = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[btn setTitle:rowText forState:UIControlStateNormal];
[btn addTarget:self action:@selector(myActionbtnText:) forControlEvents:UIControlEventTouchUpInside];
btn.frame = CGRectMake(60, 40+2*(40*i), 200, 40);
btn.alpha = 0.81;
[self.view addSubview:btn];
}
I got error at assign Action to dynamic button MY action is given Below
-(void) myAction:(NSString *)btnText;
{
NSLog(@"%@ Button Clicked",btnText);
}
© Stack Overflow or respective owner