I have an array named bookmark,it contains values,i displayed it in a tableview cell,i know how to display it in tablecell.but i want the same array to display it in textview.this is my code for tableview.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [bookmarks count];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
UIImageView* img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bgCELL3@2X-1"]];
[cell setBackgroundView:img];
[img release];
}
cell.textLabel.font =[UIFont fontWithName:@"Georgia" size:15];
cell.selectionStyle = UITableViewCellSelectionStyleGray;
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@:%@ ",[[bookmarks objectAtIndex:indexPath.row] objectForKey:@"book"],[[bookmarks objectAtIndex:indexPath.row] objectForKey:@"chapter"],[[bookmarks objectAtIndex:indexPath.row] objectForKey:@"verse"],[[bookmarks objectAtIndex:indexPath.row] objectForKey:@"text"]];
// Set up the cell...
return cell;
}
i want to replace cell.textlabel.text with mytextview.text = ?.Please help me to do this.
Thanks in advance.
You can set text of your
UITextViewin the same manner as text ofUILabelOr, for example, in loop: