title: I am making an iOS app that take a panoramic picture on its own
body: <p>iPhone can be stood on the ground and then, when it vibrates, it spins on the ground
  so we can use this feature to take a panoramic picture.
  actually there is an app that functions the same I wrote above. The app is called "Cycloramic"
  It could be meaningless, but I want to build this app to study iOS programming.</p>
  
  <p>Now I faced a problem, that it just vibrates, ignores a part of taking pictures.</p>
  
  <p>this is the code.</p>
  
  <p>when I pushed the button, it starts.</p>
  
  <p>first, it takes a picture then vibrates until it rotates 29 angle. Then it takes one more picture.
  This is what it is meant to function.</p>
  
  <p>But, when I start the app, it only vibrates and never takes a picture at all.</p>
  
  <p>what is wrong with it?</p>
  
  <pre><code>if([self.rangeSelectionButton.title isEqualToString:@"90"])
  {
      range = 90;
  }
  else if ([self.rangeSelectionButton.title isEqualToString:@"180"])
  {
      range = 180;
  }
  else if ([self.rangeSelectionButton.title isEqualToString:@"270"])
  {
      range = 270;
  }
  else if ([self.rangeSelectionButton.title isEqualToString:@"360"])
  {
      range = 360;
  }
  else
  {
      return;
  }
  
  
  switch (range)
  {
      case 90:
          [self.imagePickerController takePicture];
          [self.motionSensor updateGyro];
          self.beforeRoll = self.motionSensor.roll;
  
          for(;(self.motionSensor.roll - self.beforeRoll) &lt;= 29;){
              AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
              [self.motionSensor updateGyro];
          }
  
          [self.imagePickerController takePicture];
  
          [self.cameraTimer fire];
          break;
      case 180:
  
          break;
      case 270:
  
          break;
      case 360:
  
          break;
  
      default:
          break;
  }
  </code></pre>
  
  <p>I posted entire code above.
  The if statements check the angle I want to take a pictures.</p>
  
  <p>The switch statements functions, according to angle. I was writing only 90 angle part.
  Thanks.</p>