I have an NSMutableArray with 3 UIButtons and Second NSMutableArray with 50 UIButtons. I want to take these 3 UIButtons Titles to Assign it Character by Character to each U
Thanx for helping Every one ..but i done it here is code.my be it help some one others.
- (void)getbuttontitle {
for(int i = 0;i<[buttons count];i++)
{
if(i == 0)
{
UIButton *b1 = [buttons objectAtIndex:0];
a = (NSString *)[[b1 titleLabel] text];
[storewords addObject:a];
NSLog(@"b=%@",a);
}
else if(i == 1)
{
}
else if(i == 2)
{
}
}
}
for (NSString *str in storewords) {
if (str==a) {
int j = 0;
int randn= (arc4random()%5)+1 ;
NSLog(@"n=%d",randn);
for (int i=randn; i<[a length]+randn; i++) {
NSLog(@"a=%@",a);
NSString *ichar = [NSString stringWithFormat:@"%c", [a characterAtIndex:j]];
UIButton* b = [saveBtn objectAtIndex:i];
NSLog(@"a=%@",ichar);
j++;
[b setTitle:ichar forState:UIControlStateNormal];
}
}
if (str==c) {
}
if (str==d) {
}
}