ipad accelerometer doesn't work -


I have created a visual controller that works fine on my iPhone, I sent this view controller in the iPad app . The friend but the accelerometer was not working ... here is the code I used:

I made the announcement:

   

This is in my viewcounter code

  - (zero) viewDidoadload {[Super Viewedload]; [[UIAccelerometer shared accelerometer] setUpdateInterval: 1.0 / kUpdateFrequency]; [[UIAccelerometer shared accelerometer] Set Deliaget: Self]; }  

and then:

  - (zero) accelerometer: (UIAccelerometer *) Accelerometer did the speed: (UIAcceleration *) Acceleration {accelValueX. Text = [NSString StringWithFormat: @ "x:% 0.3f", acceleration. X]; AccelValueY.text = [NSString stringWithFormat: @ "y:% 0.3f", acceleration. Y]; AccelValueZ.text = [NSString stringWithFormat: @ "z:% 0.3f", Acceleration. Z]; }  

But the 3 labels did not change the text ... The only difference between the iPhones and the iPad is that the view controller on the iPhone is the base view controller, and on the iPad I added this way View controller of:

  accel = [[Acceleration Week control alloc] initWithNibName: @ "Acceleration View Controller" bundle: [NSBindal main bundle]]; Accel.view.frame = CGRectMake (2, 46, 1020, 720); [Self.view addSubview: accel.view];  

Solution ... In the interface builder I forgot to link the label to accelValueX ...: (


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -