Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>The error I get is as follows:</p> <pre><code>2009-10-13 17:13:51.708 MyApp[7467:20b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSCFSet contactsButtonPressed:]: unrecognized selector sent to instance 0x4c27330' </code></pre> </blockquote> <p>You're probably under-retaining whatever controller object of yours is supposed to receive that action message. Add an NSLog call in the controller's <code>dealloc</code> method; you'll probably find that it gets deallocked before you expect it to.</p> <p>The question to ask then is what should own that controller. Then, make sure that all of the owners are retaining it.</p> <p>If you're holding the controller in a property, make sure that you actually use that property. A common mistake is to write <code>myController = theController</code>, which bypasses the property and assigns directly to the instance variable, instead of <code>self.myController = theController</code> (property access syntax, implicit accessor message) or <code>[self setMyController:theController]</code> (explicit message syntax).</p> <p>Also, if you've implemented your own accessors for the property (especially <code>setMyController:</code>), make sure your setter releases the old object and retains the new one. Of course, this is assuming you have a reason to implement your own accessor; normally, you should simply <code>@synthesize</code> the property and let the compiler write the accessor for you.</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