views:

385

answers:

2

Wondering what code in objective-c should I use to shake the iPhone continuously...

+2  A: 

You may want to use the code from "How do you make the iPhone vibrate for arbitrary durations?":

extern void * _CTServerConnectionCreate( CFAllocatorRef, int (*)(void *, CFStringRef, CFDictionaryRef, void *), int *);
extern int _CTServerConnectionSetVibratorState(int *, void *, int, int, float, float, float);

// Initialize
connection = _CTServerConnectionCreate(kCFAllocatorDefault, &vibratecallback, &x);

// Start Vibration
_CTServerConnectionSetVibratorState(&x, connection, 3, intensity, 0, 0, 0);

// End Vibration
_CTServerConnectionSetVibratorState(&x, connection, 0, 0, 0, 0, 0);

I bet this will make it quite difficult for your application to get approved for AppStore! Check out the Unofficial App Store Rejection Criteria.

Daniel Vassallo
A: 

Don't do this. Besides the fact it could get you rejected, it's simply bad form.

Ken Wootton