How to correctly wire up an interface?

Discussion in 'Mac Programming' started by zorro2b, Jun 18, 2008.

  1. zorro2b macrumors newbie

    Jun 18, 2008
    I have tried a couple of tutorials on the web. I am using XCode 3.1. This is the latest one I have tried:

    Now I got to the end of the tutorial, but the application does not clear the textview as expected. I have run it under the debugger and the clearText method on the AppController is actually being called when I click the clear button. However the [textView setString: @" "]; does not do anything.

    I have downloaded the completed example from the site above, and while theirs works I can't see any obvious difference.

    The AppController has a clearText action and a textView outlet.

    Any suggestions on how I can work out what is wrong?
  2. lucasgladding macrumors 6502

    Feb 16, 2007
    Waterloo, Ontario
    Try setting a breakpoint in your setString: method and check to make sure the NSTextView is being recognized by the controller. Make sure that your outlet is linked to the view before doing anything else.

    When things don't behave when you think they should, checking with the debugger for nil variables is a good first step.

    Best of luck
  3. zorro2b thread starter macrumors newbie

    Jun 18, 2008
    I figured it out. I had linked the outlet to the bordered scroll view instead of the text view that it enclosed.

    Also, is it possible in the debugger to inspect the object to determine what methods it has defined?

Share This Page