tags:

views:

299

answers:

1

hi .. i build an app, now i want disable my shaking with setting bundle when iphone is shaking and vibrating

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Setting Bundle :

Title: Vibrate //// Key : dis_vib//// Type : PSToggleSwitchSpecifier

A: 

Before you call the vibration code, check to see what the NSUserDefaults say.

For example:

if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ShouldVibrate"]){
   //Vibrate code
}

Where "ShouldVibrate" is what the settings bundle is setting.

Tom Irving
sorry doesn't work <<<< if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ShouldVibrate"]){ AudioServicesPlaySystemSound (kSystemSoundID_Vibrate); }>>>>
Momeks
"ShouldVibrate" can be anything. Make sure it matches the key in the settings bundle you've made.
Tom Irving
Change "ShouldVibrate" to "dis_vib".
Tom Irving