advertisement

Article:
  Mac OS X's Preferences System (and More!)
Subject:   tests for nil in awakeFromNib incorrect
Date:   2001-08-31 19:04:10
From:   mikebeam
Response to: tests for nil in awakeFromNib incorrect

Okay, i posted before i finished what i wanted to say: So in the first if statement, we test to see if the key exists in the user's prefs, if so, then we go ahead and use prefs to initialize records, if not we move onto the next if statement. In if-number-two we test to see if the file recordsFile exists at the path, using the NSFileManager method fileExistsAtPath:, which returns a BOOL. If the return value is YES, then we initialize records from the file on disk. if now, then we initialize to an empty array. Again, if you want you can put [self saveData] in the code block for the second if statement and the else code block. As you can see this is only one way to do it. If someone comes up with another way, share it with us!


Mike


1 to 1 of 1
  1. tests for nil in awakeFromNib incorrect
    2003-05-18 20:33:11  anonymous2 [View]

1 to 1 of 1