Hi,

That was all that showed up in the debugger, but in the class otherClass there 
is a method called doSomething. 
I have also tried what you suggested - [otherClass doSomethingElse] - but i get 
a warning in xcode, http://cld.ly/7c4la.
(JGManagedObject is what replaces otherClass)

Thanks.



________________________________
From: Shawn Erickson <shaw...@gmail.com>
To: Joshua Garnham <joshua.garn...@yahoo.co.uk>
Cc: cocoa-dev@lists.apple.com
Sent: Wednesday, 21 October, 2009 18:02:55
Subject: Re: Sending a Selector to another Class.




On Wed, Oct 21, 2009 at 9:23 AM, Joshua Garnham <joshua.garn...@yahoo.co.uk> 
wrote:

>How would I send a Selector to another class?
>>I know to send it to a selector in the same file you do
>>[self performSelector:@selector(doSomething)];
>

Why not simply... [self doSomething] ?
 
>
>and for sending it to another class I've tried
>>[otherClass performSelector:@selector(doSomethingElse)];
>

Why not simply [otherClass doSomethingElse] ?

...aka... Why are you using performSelector in the above?
 
>But I just get an error in the Debugger saying
>>+[otherClass doSomethingElse]: unrecognized selector sent to class 0xe5c4
>
>>What have I done wrong?
>

You are sending a message to an object that doesn't respond to that message 
(aka no implementation for it). The error message you listed should have more 
information about the class of the object you messaged incorrectly, what does 
the rest of it say?

Hard to tell what may be going wrong with the limited information you have 
posted. I rather not waste time guessing (can think of at least 4 common things 
you could be doing wrong).

-Shawn



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to