I just upgraded to Xcode 3.2 and am using the Build and Analyze feature to check old code for errors.
While doing something I thought was innocuous, I get this error:
"Dead store: Value stored to 'newBook' during it's initialization is never read in SpellTest.m"
#define kSpellBookFilename @"TestBookSaver"
-(void)testBookLoadFromDisk;
{
// restore object from disk
SpellBook *newBook = [[[SpellBook alloc] init] autorelease];
newBook = [NSKeyedUnarchiver unarchiveObjectWithFile:kSpellBookFilename];
// show restored object
NSLog(@"archived copy %@", newBook);
}
Am I initializing this object wrong or is this a false positive?