這可能是最簡單/最遲的問題。viewDidLoad變成無限循環。幫助
所以我想在viewDidLoad方法與值初始化數組的0.25 0至3的增量,並且在這裏我可以看到一個無限循環。
NSArray *pickArray3 = [[NSMutableArray alloc] init];
int i = 0;
//for(i = 0.25; i<=3; i=i+0.25)
while (i<3)
{
//NSString *myString = [NSString stringWithFormat:@"%d", i];
i=i+0.25;
NSLog(@"The Value of i is %d", i);
//[pickArray3 addObject:myString]; // Add the string to the tableViewArray.
}
NSLog(@"I am out of the loop now");
self.doseAmount=pickArray3;
[pickArray3 release];
,這是輸出。
2011-06-01 11:49:30.089 Tab[9837:207] The Value of i is 0
2011-06-01 11:49:30.090 Tab[9837:207] The Value of i is 0
2011-06-01 11:49:30.091 Tab[9837:207] The Value of i is 0
2011-06-01 11:49:30.092 Tab[9837:207] The Value of i is 0
// And this goes on //
// I am out of the loop now does not get printed //
..................... FML – Legolas 2011-06-01 15:59:28
非常細心的你tofutim .... – Sid 2011-06-01 16:08:09
變化的NSLog ... – Jhaliya 2011-06-01 16:11:59