title: Shared the file within two target using GROUP APP
body: <pre><code>- (void) readTheFile{
  
      NSError *error;
      NSFileManager *fileManager = [NSFileManager defaultManager];
      NSString *path = [self getTheFilePath];
  
      if (![fileManager fileExistsAtPath: path])
      {
          NSString *bundle = [[NSBundle mainBundle] pathForResource:@"setting" ofType:@"plist"];
  
          [fileManager copyItemAtPath:bundle toPath: path error:&amp;error];
      }
  }
  
  - (NSString *)getTheFilePath{
  
      NSURL *url =  [[NSFileManager defaultManager]     containerURLForSecurityApplicationGroupIdentifier:@"com.group.test"];
      NSString *path = [url.absoluteString stringByAppendingPathComponent:@"setting.plist"]; 
      path = [path stringByReplacingOccurrencesOfString:@"file:" withString:@""];
      return path;
  }
  </code></pre>
  
  <p>Hi All, I got a confuse problem.<br>
  I have a two target in one project, one is extension target.<br>
  So I want to share some plist file in both target. So I created group App in Capabilities for both target successfully.<br>
  My idea is I created the plist file in one target and other extension app need to check the same location (above code) and check the file exist or not.  If not exist create the new plist file.<br>
  I tested on simulator everything fine.<br>
  but when i run on the device, all strange things come out.<br>
  When i read the file, getTheFilePath give the correct path but when I checked the file exist or not. It show NO.
  But actually I already created the file from first target.<br>
  So the program continue and copy the file from Bundle and paste into the path.<br>
  But I got the error about files already exist.   </p>
  
  <pre><code>Error Domain=NSCocoaErrorDomain Code=516 "The operation couldn’t be completed. (Cocoa error 516.)" 
  "The operation couldn’t be completed. File exists"  
  </code></pre>
  
  <p>Sometimes it restart the device automatically.  WHY?</p>
  
  <p>Please help me, I'm using xCode 6 beta and tested on iOS8 iPhone5s</p>