Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 519863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:05:07+00:00 2026-05-13T08:05:07+00:00

I am working on a project that has a uitableview with 3 rows in

  • 0

I am working on a project that has a uitableview with 3 rows in 1 section. Now, is what I would like to do is to be able to have 1 of those 3 cells be dynamic in height. First off, I don’t even know if thats possible. If it is, then I want to do it! I found a very useful tutorial helping me through it, here. I implemented the StringHelper files he recommended, and they work great for one cell, but when there are multiple cells, I begin to have issues. This picture illustrates what happens when I save the text:alt text http://www.freeimagehosting.net/uploads/e7351da3ea.png

And as you can see for whatever reason randomly inserts a nice little arab looking symbol at the beginning.

So, here is the code I am working with:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{  
NSString *label = [entree.notes/*putting entree.notes here may or may not be correct*/ length]  == 0 ? kDefaultNoteLabel : aNote;
CGFloat height = [label RAD_textHeightForSystemFontOfSize:kTextViewFontSize] + 40.0;
return height;
}  


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];
 cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
  }
aNote = entree.notes; 
NSString *label = [aNote length] == 0 ? kDefaultNoteLabel : aNote;
switch (indexPath.row) {
    case 0: 
 cell.textLabel.text = @"Name";
 cell.detailTextLabel.text = entree.title;
break;
    case 1:
cell.textLabel.text = @"Date";
cell.detailTextLabel.text = [self.dateFormatter stringFromDate:entree.date];
break;
    case 2:
 //aNote = entree.notes;
 if ([[cell.contentView subviews] count] > 0) {
   id view = [[cell.contentView subviews] objectAtIndex:0];
   UILabel *labelToSize = view;
   [label RAD_resizeLabel:labelToSize WithSystemFontOfSize:kTextViewFontSize];
 } else {
   UILabel *cellLabel;
  cellLabel = [label RAD_newSizedCellLabelWithSystemFontOfSize:kTextViewFontSize];
  [cell.contentView addSubview:cellLabel];
  [cellLabel release];
 }

  cell.textLabel.text = @"Notes";
  cell.detailTextLabel.text = entree.notes;// description];
  break;
 }
  return cell;
}

Where entree is the name of my NSManaged Object, and title, date, notes are the attributes. All I need is to be able to set cell 3, or the notes attribute to a dynamic height so that when they input large amounts of text, that cell and only that cell moves, and everything else stays the same. As you can see, I have been trying some things, I apologize if it has gotten kind of messy, but this current setup of code, produces the images above, which is close, but not quite there. It may just be a quick fix, so if anyone out there can help me out, it would be greatly appreciated! Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:05:07+00:00Added an answer on May 13, 2026 at 8:05 am

    I wrote a blog post on this as well that provides code for multiple cells. You can read it on Cocoa Is My Girlfriend.

    Your code in your answer is unreadable because you didn’t format it correctly. You’ll probably get more/better feedback if you fix that.

    Best Regards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project that currently has zero users but we would like
I am working on a project that has a piece of code like the
I am working on a project that has to have authentication (username and password)
I have been working on a project that has 2 interfaces - windows forms
I'm working on a project that has components, components have features, features have bugs.
I am working on a project that has the potential to have a large
I have been working on a project that has common bits of functionality, specifically
Im working on a project that has an implementation of JOSSO in place. We
I'm working on a project that has two modules: a web and an application
I am working on a project that has a class 'A' that contains a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.