私のプログラムは正常に動作しているようで、必要なすべての計算を行っているようです。プログラムが必要とする最後の部分は、インクリメント カット リストです。そのため、NSMutable 配列を作成し、以前に設定した変数を使用して、最終的にテーブルに入力しようとしました。コードを実行して計算ボタンを押すと、プログラムがフリーズし、NSLOG などに何も表示されません。for ループの外側で設定された以前の変数を使用できませんか? または何が起こっているのですか?
-(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]];
}
}