Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zorro2b

macrumors newbie
Original poster
Jun 18, 2008
2
0
I have tried a couple of tutorials on the web. I am using XCode 3.1. This is the latest one I have tried:
http://www.cocoadevcentral.com/d/learn_cocoa_two/

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?
 

lucasgladding

macrumors 6502
Feb 16, 2007
319
1
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
 

zorro2b

macrumors newbie
Original poster
Jun 18, 2008
2
0
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

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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.