title: Why can not i get path of plist file in my project?
body: <p>I am using this function to get path of a plist file in my project:</p>
  
  <pre><code> + (NSString *) appDataPath{
  NSLog(@"in appDataPath");
  NSString *appDPath = nil;
  // Get the main bundle for the app.
  NSBundle* mainBundle = [NSBundle mainBundle];
  
  if (mainBundle != nil) {
      NSLog(@"in appDataPath mainbundle");
      appDPath = [mainBundle pathForResource:@"MyAppSettings" ofType:@"plist"];
      NSLog(@"appDataPath: %@", appDPath);
  }
  
  return appDPath;
  }
  </code></pre>
  
  <p>It goes in if(mainBundle != nil) but appDPath is null. This same function is working in one other project. Why is it not working here? Is there any other way to get path of a plist file in project. Thanks in advance.</p>