Sono un po 'nuovo allo sviluppo di app. In un viewController (VPviewController) Ho il seguente codice:xcode ios 6 motion shake chiama IBaction dalla vista precedente
- (void) motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{
if (motion == UIEventSubtypeMotionShake){
[self startGame:nil];
}
}
In un diverso viewController (VPgameViewController) ho un diverso evento MotionShake:
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
if(event.subtype == UIEventSubtypeMotionShake){
if(count < 3){
[self changeText:nil];
AudioServicesPlaySystemSound(1016);
count++;
}else{
count = 0;
AudioServicesPlaySystemSound(1024);
UIStoryboard *storyboard = self.storyboard;
VPpoepViewController *shit = [storyboard instantiateViewControllerWithIdentifier:@"PoepViewController"];
shit.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:shit animated:YES completion:nil];
}
}
}
Quando sono nella VPgameView e io scuoto l'Iphone chiama anche la funzione startGame che si trova in un evento shake viewController diverso.
Come posso interrompere questo?
Forse questo (http://stackoverflow.com/questions/1342674/motionbegan-not-working) aiuta – basvk
In entrambe le visualizzazioni ho potuto diventare primo risponditore e dimettermi primo risponditore. Ma questo non aiuta. –
Vuoi rilevare il movimento in Xcode o in iOS? In quest'ultimo caso, non confondere iOS con Xcode. Uno non ha bisogno di Xcode per scrivere applicazioni iOS. –