In Xcode 3.2 in iPhone-SDK 3.1, how do I avoid the "dead storage" error from the CLANG parser?
I just upgraded to Xcode 3.2 and use Build and Analyze to check the old code for errors.
While doing something that I thought was harmless, I get this error:
"Dead store: value stored in" newBook "during its initialization is never read into 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 incorrectly or is this a false positive?
+2
source to share