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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:17:32+00:00 2026-06-03T18:17:32+00:00

ok so my program seem to be running fine and doing all the calculation

  • 0

ok so my program seem to be running fine and doing all the calculation i need, the last piece the program need is an incrementing cut list. So i have tried to build an NSMutable array and use previously set variables, which i will eventually populate a table with. only when i run the code and hit the calculate button, the program freezes, and nothing shows in NSLOG etc.
can i not use previous variables set outside the for loop? or whats going on?

-(IBAction)calculateGo
{
    BuildNavAppDelegate *buildNavDelegate = (BuildNavAppDelegate *)[[UIApplication sharedApplication] delegate];

    float iridge = ([ridge.text intValue]);
    float ihip = ([hip.text intValue]);
    float ispacing = ([rafterSpace.text intValue]);

    float floatTLPMR = [buildNavDelegate.TLPMR floatValue];
    int floatRafter = [buildNavDelegate.raftThicknessPassed intValue];
    int comraftbird = [buildNavDelegate.comRaftBirdPassed intValue];

    float mitre = (45 * M_PI) / 180;
    float y = tanf(mitre);
    float mitreThickness = sqrt((y*y)+1) * ihip;

    float TLRafterSpace = (floatTLPMR * ispacing);

    float firstCreeper =  (TLRafterSpace + (mitreThickness/2))-(floatRafter/2);
    firstCreep.text = [[NSString alloc] initWithFormat:@"%.1f", firstCreeper];

    float comSetBack = floatTLPMR * (iridge/2);
    comRaftSetBack.text = [[NSString alloc] initWithFormat:@"%.1f", comSetBack];

    float crownSetBack = (floatTLPMR * (floatRafter/2));
    crownEndSetBack.text = [[NSString alloc] initWithFormat:@"%.1f", crownSetBack];

    creeperArray = [[NSMutableArray alloc] initWithCapacity:20];

for (int x = firstCreeper; x <= comraftbird; x + TLRafterSpace) {
[creeperArray addObject:[NSString stringWithFormat:@"%d", x]];
}
}
  • 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-03T18:17:33+00:00Added an answer on June 3, 2026 at 6:17 pm

    You are stuck in an infinite loop because you forgot to increment the value of x:

    for (int x = firstCreeper; x <= comraftbird; x + TLRafterSpace)
                                                 ^^^^^^^^^^^^^^^^^
    

    That should probably be:

    for (int x = firstCreeper; x <= comraftbird; x += TLRafterSpace)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small ncurse program I'm running, but the output doesn't seem to
I'm writing a flashcard program and am running into an issue I always seem
I have a simple java program that runs fine in eclipse but cannot find
Only first pair of values output on running this program seem correct, the others
I need to find the path of where my program is running. Using argv[0]
I have a program that is running inside eclipse right now and uses a
I have written a small program in WindowsXP-python-pygame. It runs fine when I run
I have two physical iPod touch devices. If I try running a program that
I need to unzip a file while running a C++ program (as described in
I'm writing a program and I seem to be creating alot of objects where

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.