Use of undeclared identifier 'dvController'

Discussion in 'iOS Programming' started by lJoct03, Oct 18, 2011.

Thread Status:
Not open for further replies.
  1. lJoct03, Oct 18, 2011
    Last edited by a moderator: Oct 18, 2011

    lJoct03 macrumors member

    Joined:
    Nov 18, 2009
    #1
    Please help.

    Code:
    //Initialize the detail view controller and display it.
        DetailViewController *dvController = [[DetailViewController alloc] init]; [SIZE="1"][B]<--- Use of undeclared identifier 'dvController'[/B][/SIZE]
        dvController.selectedCountry = selectedCountry; [SIZE="1"][B]<--- Use of undeclared identifier 'dvController' / Local declaration of 'selectedCountry' hides instance variable[/B][/SIZE]
        [self.navigationController pushViewController:dvController animated:YES]; [SIZE="1"][B]<--- Use of undeclared identifier 'dvController'[/B][/SIZE]
        [dvController release]; [SIZE="1"][B]<--- Use of undeclared identifier 'dvController'[/B][/SIZE]
        dvController = nil; [SIZE="1"][B]<--- Use of undeclared identifier 'dvController'[/B][/SIZE]
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    Have you #import'ed the .h file declaring DetailViewController?

    What is the line immediate before the first line you posted? Perhaps an error on that line is the root cause and these are subsequent errors.
     
  3. lJoct03 thread starter macrumors member

    Joined:
    Nov 18, 2009
    #3
    these are my warnings/errors now:
     

    Attached Files:

  4. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #4
    Did returning UITableViewCellAccessoryDisclosureIndicator in tableView:cellForRowAtIndex: ever work?! That method's meant to return a UITableCell*. UITableViewCellAccessoryDisclosureIndicator is a member of the UITableViewCellAccessoryType enum. Your meant to assign it to a cell's accessoryType property and then return the cell itself.

    I'll leave the deprecation warnings for you. Search this forum for the answers.

    Do you in fact have a selectedCountry property or instance variable in this class? If you do, did you mean to access that instance variable or declare a local variable? If meant to declare a local variable, you should rename the local variable to be something different to avoid potential confusion.
     
  5. lJoct03 thread starter macrumors member

    Joined:
    Nov 18, 2009
    #5
    everything is perfect now except for this:
     

    Attached Files:

  6. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
Thread Status:
Not open for further replies.

Share This Page