CLang error (objective C): value stored during initialization is never read

Posted by Scott Pendleton on Stack Overflow See other posts from Stack Overflow or by Scott Pendleton
Published on 2010-04-15T15:18:09Z Indexed on 2010/04/15 15:33 UTC
Read the original article Hit count: 678

Foo *oFoo = [[[Foo alloc] init] autorelease];

This is how I was taught to program in Objective C, yet the CLang error checker complains that the initial value was never read. But oFoo is an object with properties. oFoo itself has no single value. The property values are what matter.

oFoo.PropertyA = 1;
oFoo.PropertyB = @"Hello, World."

Should I just ignore this? Is this worth fixing? What is the fix, seeing that "initial value" is meaningless in my context?

© Stack Overflow or respective owner

Related posts about clang-static-analyzer

Related posts about objective-c