Hi all,
I have problems with integrating two different accelerometer classes.
In my first class I am writing data to a path/file:
Quote:
- (void)accelerometer: (UIAccelerometer *)accelerometer didAccelerate: (UIAcceleration *)accel {
NSDate *now = [NSDate date];
NSTimeInterval interval = [now timeIntervalSinceDate:startDate];
NSString *loggedData = [NSString stringWithFormat:@"%f,%f,%f,%f\r\n", interval, accel.x, accel.y, accel.z];
[self writeToFile:loggedData];
}
|
But now I want to integrate another function into these class to count a certain movement while writing my data...
Quote:
- (void)accelerometer2: (UIAccelerometer *)accelerometer didAccelerate: (UIAcceleration *)acceleration {
if ( fabsf(acceleration.x) > kAccelerationThreshold) {
movement++;
NSString *movementcount = [NSString stringWithFormat:@"%d", movement];
[moves setText:movementcount];
}
}
|
Does I have to write a new class or should it be all in one class?
Thanks in advance