I am analyzing an iPhone Objective-C project using the LLVM / Clang static analyzer. I keep getting two errors reported, but I'm sure the code is correct.
1) Convenience method.
+ (UILabel *)simpleLabel
{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 10, 200, 25)];
label.adjustsFontSizeToFitWidth = YES;
[label autorelease];
return label;
}
2) [NSClassFromString (...) alloc] returns keepCount + 1. Am I correct?
Class detailsViewControllerClass =
NSClassFromString(self.detailsViewControllerName);
UIViewController *detailsViewController =
[[detailsViewControllerClass alloc]
performSelector:@selector(initWithAdditive:) withObject:additive];
[self.parentController.navigationController
pushViewController:detailsViewController animated:YES];
[detailsViewController release];
Are these some clan problems, or am I mistaken in both cases?
source
share