Major Nubie : adding ints get strange values?
Major Nubie : adding ints get strange values?
- Subject: Major Nubie : adding ints get strange values?
- From: d2kagw <email@hidden>
- Date: Thu, 6 Apr 2006 22:24:56 +1000
Hi there,
Apologies for the major newbie question...
Heres some code from an app im writing, im getting really strange
data from the variable currentIndex.
instead of getting 1 or -1, I get 4 or -4, and if I run [self left]
again, I get 8 and then 12, 16, 20 etc
im sure its something REALLY simple that i've just missed... but I
can't find anything in the net !?
- ( id ) init
{
currentIndex = 0; <-- currentIndex is an int, its declared in the
header
return self;
}
- ( void ) selectChild:(int *)selectedIndex
{
currentIndex = selectedIndex;
NSLog(@"moving : %i", currentIndex);
}
- ( void ) left : ( NSNotification * ) notification
{
[self selectChild:( currentIndex + 1 )];
}
- ( void ) right : ( NSNotification * ) notification
{
[self selectChild:( currentIndex - 1 )];
}
thanks a gazillion for your time
- Aaron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden