C'est probablement la question la plus facile/la plus faible.viewDidLoad devient une boucle infinie. AIDE
Donc j'essaie d'initialiser un tableau avec des valeurs de 0 à 3 incréments de 0.25 dans la méthode viewDidLoad, et je peux voir une boucle infinie ici.
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];
Et c'est la sortie.
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
Très observatrice de vous tofutim .... – Sid
changement NSLog ... – Jhaliya