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 8211679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:30:33+00:00 2026-06-07T10:30:33+00:00

What i am doing is to get data from the database. I then want

  • 0

What i am doing is to get data from the database. I then want to add that data into text views and add those textviews onto a scrollviewer.

But nothing is showing up. I know that there is data but it’s just not showing. Most likely i’m missing to set something.

- (void)viewDidLoad
{
    NSUInteger height = 0;

    for (NSUInteger i = 0; i < [data count]; i++){
        DBMiscData *row = (DBMiscData *) [data objectAtIndex:i];

        if (row.text != nil){
            UITextView *tv = [[UITextView alloc] init];
            [tv setFont:[UIFont boldSystemFontOfSize:12]];
            tv.text = row.text;
            [_scrollerView addSubview:tv];
            [tv sizeToFit];
            height+=(NSUInteger)tv.frame.size.height;
        }
    }

    [_scroller setScrollEnabled:YES];
    [_scrollerView setFrame:CGRectMake(0, 0, 320, height)];
    [_scroller setContentSize:CGSizeMake(320, height)];
    [_scroller addSubview:_scrollerView];

    [super viewDidLoad];
}

Updated code and what i am after

What i want is simple same as i have in android.

android:layout_width=”fill_parent” and android:layout_height=”wrap_content”.

  • 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-06-07T10:30:36+00:00Added an answer on June 7, 2026 at 10:30 am

    CGRectFromString(aString) does not return you the rectangle in which that text fits.
    If you have a string like {{5, 10}, {100, 130}} , that method will create a CGRect for you that will have origin = CGPointMake(5,10) and size = CGSizeMake(100,130).
    If you have a string like ‘bananas’ . The CGRect resulting from this will always be CGRectZero ( aka CGRectMake(0,0,0,0) ).

    That’s why your height is zero.

    Hope this helps.

    Cheers!

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

Sidebar

Related Questions

I have a function that uses LINQ to get data from the database and
I am doing an HttpPost to get data from a php server using async
In my index file I get data from the database using this function (which
I am loading a large set of data into a database from a webservice.
hi im doing a loop so i could get dict of data, but since
I'm quite frustrated. I want to be able to insert into my database names
I am migrating data from one database schema to another. The old schema has
I have data coming in from datastage that is being put in our SQL
What am I doing wrong!?!?? I am trying to get a set of data
I'm working with some data which is being retrieved from my database. It's placed

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.