Struggling with a loop
Posted
by Emil
on Stack Overflow
See other posts from Stack Overflow
or by Emil
Published on 2010-04-26T15:59:38Z
Indexed on
2010/04/26
16:03 UTC
Read the original article
Hit count: 251
Hey.
I am trying to make an integer match another integer by adding a number to one of them. I have tried several loop types, but none has worked.
Take a look at the code:
int favoriteLoop = [favoriteThing intValue];
if (favoriteLoop != [[[array objectAtIndex:favoriteLoop] description] intValue]){
NSLog(@"%d", [[[array objectAtIndex:favoriteLoop] description] intValue]);
int favTemp = favoriteLoop;
for (int x = favTemp; (favoriteLoop == [[[array objectAtIndex:favoriteLoop] description] intValue]); x++) {
NSLog(@"Still not there..");
}
}
Could anyone help me clear up this mess? It just won't work!
Could it have something to do with it allready being inside a for-loop?
© Stack Overflow or respective owner