title: Problem reading data from a plist
body: <pre><code>- (void)viewDidLoad {
     [super viewDidLoad];
  
      paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
      NSString *documentsDirectory = [paths objectAtIndex:0]; 
      path = [documentsDirectory stringByAppendingPathComponent:@"plist.plist"]; 
  
      NSFileManager *fileManager = [NSFileManager defaultManager];
  
      if (![fileManager fileExistsAtPath: path]) 
      {
          path = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithFormat: @"plist.plist"] ];
      }
  
      NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile: path];
      int value = 5;
      [data setObject:[NSNumber numberWithInt:value] forKey:@"value"];
      [data writeToFile: path atomically:YES];
      [data release];
  
      NSMutableDictionary *savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];
      int value1;
      value1 = [[savedStock objectForKey:@"value"] intValue];
      **NSLog(@"%i",value1);**
      [savedStock release];
  
  
  }
  </code></pre>
  
  <p>I have saved the value in the plist... now I want to retrieve it. If i print that by using  NSLog it displays 0. How should I retrieve the value?</p>