http://llvm.org/bugs/show_bug.cgi?id=14258
Bug #: 14258
Summary: clang should check NSKeyValueCoding.h methods for key
and keypath naming rules
Product: new-bugs
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Two suggestions:
(1) Due to autocompletion, copy-pasting things around, or lack of coffee, I
sometimes mix up KVC keys and keypaths. ex:
[obj setValue:value forKey:@"selection.foo"];
that should be setValue:forKey*Path*:!
clang could warn whenever a '.' char is found in a string passed to one of the
'key' methods, and even have a fix-it directing the user to the 'keyPath'
variant.
(2) Even more generally, you could validate this requirement of the "Key-Value
Coding Programming Guide":
"Keys must use ASCII encoding, begin with a lowercase letter, and may not
contain whitespace"
I think these checks would be more useful in the compiler, not the static
analyzer.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs