I’ve just analyzed the whole my iPhone app and I get a Logic Error.
UILabel *first_label = (UILabel *) [cell viewWithTag:1];
UILabel *second_label = (UILabel *) [cell viewWithTag:2];
[first_label setText:@"text"];
[second_label setText:@"text"];
NSLog(@"%@", first_label); // it exist
[first_label setFrame:CGRectMake(first_label.frame.origin.x, 10, 10, 10)];
I get this issue:
The receiver of message ‘frame’ is nil and returns a value of type ‘CGRect’ that will be garbage
If i change:
[first_label setFrame:CGRectMake(first_label.frame.origin.x, 10, 10, 10)];
with
[first_label setFrame:CGRectMake(10, 10, 10, 10)];
he’s happy. Is it normal? I can get the label without problems and I can use it everywhere, but when I try to get its frame it says that issue. Have you ideas?
Analyzer just sees that there is no place where you’re adding the view with tag 1 in your code, and thats why
would probably return nil. Just set the breakpoint there and check the return value. If it is not nil, then probably analyzer doesn’t understand something in your code, cause it’s also not perfect.