Error when display the second view

Discussion in 'iOS Programming' started by iphonejudy, Sep 25, 2008.

  1. iphonejudy macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    Hi,


    I got error in the following code.

    //This code is used to display the view2 when click the button.

    -(IBAction)display:(id)sender
    {



    Test2ViewController *vController = [[Test2ViewController alloc]
    initWithNibName:mad:"Test2View" bundle:[NSBundle mainBundle]];


    //I got error in this line only.The simulator stops in tis line
    self.view2Controller=vController;


    [vController release];


    [window addSubview:[view2Controller view]];


    [window makeKeyAndVisible];

    }
    Can anybody please tell me the reason for the error?

    Thanks
    judy
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    1. Use code tags. It makes the code you post more readable
    2. What, exactly, is the error?
     
  3. iphonejudy thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #3
    Hi,


    When i run the application.The simulator stops and it highlight the below line

    self.view2Controller=vController;

    Thanks
    judy
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Yes, but it will post an error, either on screen somewhere or in the logs. Without that we are all just guessing at what we are supposed to be looking for.
     
  5. iphonejudy thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #5
    When i run the application .When i am pressing the button,it stopped and it highlight that line in the screen.The error shows below the window like

    GDB:Stopped at brekpoint 1(hit count:1)-'-display:-Line 24'


    Thanks
    judy
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  7. iphonejudy thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008

Share This Page