I stored some text value in server. I successfully fetched that text value and stored to local database file. Then added that values to array. when i display that array values to UITextView. But textview displaying all the values. I have button to click index. If i click first button i need to display first text. Then next for next button. If i click every button, it displays all the values.
code:
-(void)dbClicked:(id)sender{
[mmageView setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[productimg_array objectAtIndex:[sender tag]-1]]]]];
[self.view addSubview:mmageView];
UITapGestureRecognizer *singletapp=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(singleTap:)];
singletapp.numberOfTapsRequired=1;
[mmageView addGestureRecognizer:singletapp];
}
- (void)singleTap:(UIGestureRecognizer *)singletap {
UITextView *txt=[[UITextView alloc]initWithFrame:CGRectMake(50, 50, 150,150)];
NSMutableString *string = [NSMutableString string];
for(int i=0;i<[descript_array count];i++){
NSLog(@"descript array is is %d",i);
txt.text = [descript_array objectAtIndex:i];
}
[self.view addSubview:txt];
}
NSLog:
descript array is is 14
string is the name is image with black color
the name is image with black color
the name is image with white color
the name is
the name is
the name is
the name is
the name is
the name is
the name is
the name is
the name is
descript array is is 15
string is the name is image with black color
the name is image with black color
the name is image with white color
the name is
the name is
the name is
the name is
the name is
the name is
the name is
the name is
the name is