Table View Whats Wrong?

Discussion in 'iOS Programming' started by iLoveDeveloping, Nov 15, 2009.

  1. macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
  2. macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #2
    Might not be your problem, but if you are comparing 2 string you should be using isEqualToString: not isEqual:


    Code:
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    	
    	if ([[tableList objectAtIndex:indexPath.row] isEqual:@"First View"])
     
  3. Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
  4. thread starter macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #4
    Thanks
     
  5. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #5
    Open up the debugger console in Xcode. What does it say about the run time exception that you're getting?
     
  6. thread starter macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #6

    "0x0081f004 <+0004> leave"?


    not really sure how to use that?

    What do i look at there are 3 windows?
     
  7. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    I don't think you've opened the debugger console. From the menu bar choose Run > Console. If your code uses NSLog or printf that's where the output goes. And when you have a run time exception some output is printed there that tells what kind of error you've encountered.
     
  8. thread starter macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #8
    Oh my bad sorry, it says
    HMMM...? i found that the third view was names ThirdView NOT ThirdViewController like it should have, fixed the first error i got, then i got this! So i made a new XIB and now it seem its not set with an outlet. How do i do that?
     
  9. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #9
    UIViewController has a built in IBOutlet called view. You need to set the value of that outlet in IB. Set it to the top level view in the nib.

    You can view all the outlets set for your File's Owner by control-click on the file's owner in the nib. Make sure your nib window is set to list view. You'll see a little black window that shows all the outlets and some other stuff.
     
  10. macrumors newbie

    Joined:
    May 24, 2009
    Location:
    India
    #10
    there are mainly:rolleyes: two reasons to get that error :

    1. You have not given File Owner the UIViewController class (By default it comes in 3.0. You need to set it in 2.2)
    2. You have not made the connection with the View properly.

    Check your file owners connections properly .

    :)
     
  11. thread starter macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #11
    Ok i got it up and running and it works great, i just rewrote the whole thing, must have just been a missing connection or something cos it worked first time now!! :)

    Anyway, one last question, is it at al possible t change the colours of the top bar in a table view, right now its the default 'blue' i hate that, i want my app to look a little more interesting, can i change that? how would i do that if its possible?
    Or can i change the colour of the cells??

    Thanks for all the help guys!! ;)
     
  12. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    There are two simple ways to change your navBar's style/color: 1) barStyle property, or 2) tintColor property.

    P.S. Please don't edit your OP and replace it with a "fixed" post. That kinda removes the impetus of the entire thread.
     
  13. thread starter macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #13
    Thanks, found that in the documentation!! Thanks for all the help... :)
     

Share This Page