Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

duny

macrumors newbie
Original poster
Sep 21, 2008
26
0
H-Town
I am trying to list a bio of myself (testing purposes) on my app. No matter what it always truncates the text. how can i list this all or create a box big enough to house all the text.

Below is my code for the table.

Code:
- (NSInteger)tableView:(UITableView *)tblView numberOfRowsInSection:(NSInteger)section {
    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }
	
	switch(indexPath.section) {
		case 0:
	        cell.image = [UIImage imageNamed:(NSString *)rankObj.RankImage];
			break;
		case 1:
			cell.text = rankObj.RankName;
			break;
		case 2:
			cell.text = rankObj.RankNum;
			break;
		case 3:
			cell.text = rankObj.RankShort;
			break;
	}
	
	return cell;
}

- (NSString *)tableView:(UITableView *)tblView titleForHeaderInSection:(NSInteger)section {
	
	NSString *sectionName = nil;
	
	switch (section) {
		case 0:
			sectionName = [NSString stringWithFormat:@"Image"];
			break;
		case 1:
			sectionName = [NSString stringWithFormat:@"Name"];
			break;
		case 2:
			sectionName = [NSString stringWithFormat:@"Rate"];
			break;
		case 3:
			sectionName = [NSString stringWithFormat:@"Abbreviation"];
			break;
	}
	
	return sectionName;
}
 

Attachments

  • Snapshot 2009-03-26 19-24-00.jpg
    Snapshot 2009-03-26 19-24-00.jpg
    23.8 KB · Views: 83

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
I don't think that is germane to the problem here. To make the text multiline you need to make a custom cell or insert a UITextView into the cell. Alternatively you need to resize the text to fit the single line you have.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.