Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It looks like your IBOutlet connections are broken. When you create an instance of <code>customers</code> in the <code>-keyDown</code> event, none of your outlets are connected. That's why it's broken. This is not a problem with inheritance, so much as object-oriented design. You probably need to rethink how your functions talk to each other.</p> <p>To prove whether this is the case (I'm sorry, but I'm having some trouble reading your code), add a log statement in your <code>-searcht:</code> function to see if it exists:</p> <pre><code>NSLog(@"name1field: %@", name1); </code></pre> <p>I'm guessing that you'll see something like: <code>name1field: (null)</code></p> <p><strong>Updated with suggested solution</strong></p> <p>If you have IBOutlets there (which strikes me as a questionable decision), that means it's instantiated in your nib. What you will probably want to do (assuming you don't drastically alter your code's structure) is create an outlet in your <code>NSSearchField</code> subclass, connect it to the <code>customers</code> object in your nib, and use that, instead of creating a new instance of <code>customers</code>.</p> <p>This is a band-aid solution, though. You may want to read up on some of the <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html" rel="nofollow">design patterns used in Cocoa code</a>. That might give you some better ideas for how to structure your classes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload