iphone shake error

Posted by aaa on Stack Overflow See other posts from Stack Overflow or by aaa
Published on 2010-05-31T18:50:47Z Indexed on 2010/05/31 18:53 UTC
Read the original article Hit count: 176

Filed under:
|
|
|
|

Right now I have this-

[code] - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (event.type == UIEventSubtypeMotionShake) { int text = rand() % 12;

switch (text) { case 0: textview.text = @"blah." ; break;[/code]

For some reason, the text has to be selected for it to work. If you just shake it, nothing will happen.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about error