Hello All,
Actually i want to apply a loop on accelerometer, means i want to start a accelerometer on behalf of loop. if i want to start loop one then want to perform accelerometer reading one time. if loop will run twice then want to run accelerometer twice. But it not happens. What should i do to control accelerometer.
Have a quick look on code
in viewdidload
for (int i=0; i<3; i++)
{
NSLog(@"Hellooooooooo",i);
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
}
and in accelerometer didAccelerate
{
float xx = -[acceleration x];
float yy = [acceleration y];
}
I don't know what is going wrong ?
help me if u have some idea about it.
thanks in advance for any help.