Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local Declaration "x" hides instance variable xcode warning

I've been have trouble understand this problem. If I change the variable name fifthViewController the error goes away but the view controller doesn't load.

Lost. Once again it's probably something simple.

Thanks in advance.

Here is the code:

{
FifthViewController *fifthViewController = [[FifthViewController alloc] initWithNibName:@"FifthView" bundle:nil];

fifthViewController.transactionID = transactionID;
[self.navigationController pushViewController:fifthViewController animated:NO]; 
[fifthViewController release];
 }
like image 324
Michael Robinson Avatar asked Mar 19 '10 02:03

Michael Robinson


1 Answers

This means the variable fifthViewController is named the same as something else in your class implementation. If you mean to use that variable, drop the FifthViewController* type declaration off the first line; otherwise, change the name fifthViewController everywhere it appears in that method.

like image 118
Tim Avatar answered Oct 15 '22 23:10

Tim