title: Unable to setObject:forKey: in NSMutableDictionary
body: <p>I'm sure I'm missing something obvious here in a simple iPhone program I'm trying to write, but the code seems so basic that I can't see what's wrong.</p>
  
  <p>I'm trying to use an NSMutableDictionary to store a list of classes and their associated save file names.  In the header file I declare the dictionary</p>
  
  <pre><code>@interface ClassList : UITableViewController {
  NSString *homedirectory;
  NSString *masterindexpath;
  NSMutableDictionary *classFilenameGlossary;
  NSMutableArray *listofclasses;
  }
  
  @property (retain, nonatomic) NSString *homedirectory;
  @property (retain, nonatomic) NSString *masterindexpath;
  @property (retain, nonatomic) NSMutableDictionary *classFilenameGlossary;
  @property (retain, nonatomic) NSMutableArray *listofclasses;
  </code></pre>
  
  <p>And, of course, in the implementation file:</p>
  
  <pre><code>@implementation ClassList
  
  @synthesize homedirectory;
  @synthesize masterindexpath;
  @synthesize classFilenameGlossary;
  @synthesize listofclasses;
  </code></pre>
  
  <p>I initialize this dictionary at ViewDidLoad from an existing file that saves the classlist:</p>
  
  <pre><code>- (void)viewDidLoad {
  [super viewDidLoad];
  
  // Get home directory
  
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  homedirectory = [paths objectAtIndex:0];
  masterindexpath = [homedirectory stringByAppendingPathComponent:@"MasterIndex"];
  
  // Get master course list or create it if necessary
  
  NSFileManager *fm = [NSFileManager defaultManager];
  if ([fm fileExistsAtPath:masterindexpath] == NO)
  {
      NSMutableDictionary *temporarydictionary = [NSMutableDictionary dictionary];
      [temporarydictionary writeToFile:masterindexpath atomically:NO];
      [temporarydictionary release];
  }
  
  [classFilenameGlossary initWithContentsOfFile:masterindexpath];
  
  [homedirectory retain];
  [masterindexpath retain];
  </code></pre>
  
  <p>}</p>
  
  <p>Later, I add an item using setObject:forKey: but the dictionary never changes.  Originally I was doing this in another view controller using a pointer back to this ClassList file, but once I discovered that didn't work, I simplified and tried to just set any sample object and key within the ClassList file:</p>
  
  <pre><code>    [classFilenameGlossary setObject:@"sample filename" forKey:@"sample classname"];
  </code></pre>
  
  <p>I've looked at the debugger variable list and it shows classFilenameGlossary properly identified as an NSMutableDictionary with 0 key/value pairs. I'm not getting any sort of error; the dictionary simply never changes.  At the moment, the dictionary loaded from the file masterindexpath is empty (since I haven't been able to add any items yet), but that shouldn't keep me from being able to add items to the dictionary.</p>
  
  <p>I'm a total beginner at iPhone programming, so I'm sure there's something basic that I'm missing.  I'd appreciate any help.</p>