title: Getting appdelegate value from viewcontroller
body: <p><strong>In Appdelegate.h</strong><br>
  I imported the <code>playerviewcontroller</code> in both <code>Appdelegate.h</code> and <code>Appdelegate.m</code> files.</p>
  
  <pre><code>  @class PlayerViewController; 
    @property(nonatomic)float volumeDelegate;        
  </code></pre>
  
  <p><strong>In Appdelegate.m</strong>        </p>
  
  <pre><code>  @synthesize volumeDelegate;
   - (void)volumeChanged:(NSNotification *)notification
   {
  volumeDelegate =1.0
      PlayerViewController *volumeObject=[[PlayerViewController alloc]init];
  [volumeObject setVolumeForAVAudioPlayer];
  }
  </code></pre>
  
  <p><strong>In Playerviewcontroller.h</strong></p>
  
  <pre><code> -(void)setVolumeForAVAudioPlayer;
  </code></pre>
  
  <p><strong>In Playerviewcontroller.m</strong></p>
  
  <pre><code>@interface PlayerViewController ()
  {
  AppDelegate *appdelegate;
  
   }
    -(void)viewDidLoad
    {
    appdelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    }
  
    -(void)setVolumeForAVAudioPlayer
    {
  [appdelegate.sharedplayer  setVolume:appdelegate.volumeDelegate];
  NSLog(@"System Volume in player view:  %f",appdelegate.volumeDelegate);
   }
  </code></pre>
  
  <p>When i run this I get <code>volumeDelegate</code> value as Zero as below.</p>
  
  <p><strong>System Volume in player view:0.000000000</strong></p>
  
  <p>What is the Mistake I'm making here</p>