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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:10:39+00:00 2026-06-14T03:10:39+00:00

I have a for loop (see below) where I add my views to my

  • 0

I have a for loop (see below) where I add my views to my view controller but when running my app, I am only seeing the first and last object be added to my view controller after running the loop. Its pretty simple, I just create the object and keep adding the next one below the one before it.

How come? Why else could I try? Thanks.

for (int i = 0; i < totalAddressCells; i++)
        {
            PersonDetailCell *cell = [[PersonDetailCell alloc] initWithFrame:CGRectMake(addressCell.frame.origin.x, (addressCell.frame.origin.y + addressCell.frame.size.height + cellSpacer) * (i +1), addressCell.frame.size.width, addressCell.frame.size.height)];

            [cell setBackgroundColor:[UIColor redColor]];

            [self.view addSubview:cell];
        }
  • 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-14T03:10:40+00:00Added an answer on June 14, 2026 at 3:10 am

    The second argument to CGRectMake looks suspicious. Shouldn’t that be

    addressCell.frame.origin.y + (addressCell.frame.size.height + cellSpacer) * (i+1)
    

    (different parentheses) ?

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

Sidebar

Related Questions

As you can see below, I have Parallel.For loop. If run the program while
In wordpress, I have the loop.php file. There I can see the 'read more'
I'm pretty new to jQuery/JS. But I have loop in jQuery where I would
I have two Sections 'A-M' and 'N-Z' as you can see below. I am
I have a LINQ Statement. It searches an XML file. (See example below) There
I have a list like df_all (see below). A = matrix( ceiling(10*runif(8)), nrow=4) colnames(A)
Please see the below code: I am have a table row defined using asp.net
See code below. I've tried to strip it to its bare bones. I have
I have a class that add extra information about a column for linq2sql (see
I have a table in in which every row contains a form. see below

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.