title: Deleting files archived with NSCoding
body: <p>I'm trying to delete all files that my application has persisted using NSCoding.  Seems like it should be a simple thing to do, but I can't find an answer, whilst I'm showing just one class here, I have several and I'd like the delete function to save all instances of all classes my app has archived.   I'm not doing anything different to NSCoder:</p>
  
  <p>So my interface is defined</p>
  
  <pre><code>Details : NSObject &lt;NSCoding&gt;
  </code></pre>
  
  <p>My implementation has:</p>
  
  <pre><code>- (id)initWithCoder:(NSCoder *)decoder
  {
      NSLog(@"initWithCoder 'Details'");
  
      if (self = [super init])
      {
          NSLog(@"Decoding 'Details'");
  
          self.name = [decoder decodeObjectForKey:@"name"];
      }
  
      return self;
  }
  
  - (void)encodeWithCoder:(NSCoder *)encoder
  {
      NSLog(@"Encoding 'Details'");
      [encoder encodeObject:self.name forKey:@"name"];
  }
  </code></pre>
  
  <p>When I write it I'm using:</p>
  
  <pre><code>NSData *data = [NSKeyedArchiver archivedDataWithRootObject:object];
  NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
  [userDefaults setObject:data forKey:identifier];
  </code></pre>
  
  <p>I did start off trying to look in the documents directory, but I think as I'm writing this and from my research that it will be written to NSUserDefaults (and that might not be the best thing).   So at the risk of asking two questions, how do I delete all my objects that are saved/archived using NSCoder to NSUserDefaults (and potentially, should I be setting this to something else (i.e a sub-folder inside the documents folder....if yes, how would I do that).</p>