views:

32

answers:

1

Hi Really puzzled why the following is happening and hope someone can help.

// here xPos correctly traces out, always changing

 //CODE EXCERPT
 CGFloat xPos=currentTouchPosition.x - lastTouch.x;

   NSLog(@"touchesMoved and xPos= %f", xPos);

    if (startTouchPosition.x < currentTouchPosition.x)
     [self adjustTimer:xPos];
    else

//here newInterval always traces as 0...why????

-(void) adjustTimer:(CGFloat)newInterval
{
 NSLog(@" adjustTimer and newInterval = %f",newInterval);
A: 

Ok resolved by changing the method argument type to 'double' from CGFloat, but confused as to why this works.

eco_bach
Under 32-bit, `CGFloat` is a `float`, which can lead to problems when types aren't explicitly known. (I know I've been bitten by this before.)
Wevah
Same problem is happening to me. How is it possible to fix that?
Kamchatka