On 22/10/2009, at 3:52 PM, Joshua Garnham wrote:
Ah, I see. so I need to send it to an instance of the class not the class it
self.
How would I do that?
With respect, please understand that your questions are akin to this:
Q. How do I start the car?
A. You turn the key.
Q. How do I drive?
With all due respect, but by 'directly answering the question' you
are doing the OP and all those reading this list a dis-service.
You are just rewarding his lazyness.
The OP has already been told to bone up on Obj-C basics, and he's
obviously completely ignored this advice, the reason being
Jens, thanks for clearing up the thing about the selector defining a message
(method plus parameters) rather than a method and thus not being tied to a
class.
On Thu, Oct 22, 2009 at 1:21 AM, Jens Alfke j...@mooseyard.com wrote:
On Oct 21, 2009, at 9:43 AM, Jim Kang wrote:
That selector is a
On Oct 22, 2009, at 5:54 AM, Jim Kang wrote:
However, a selector is not a string. I was just listening to this podcast
with Mike Ash, and he discusses this around the 9:23 mark or so:
On Oct 22, 2009, at 5:54 AM, Jim Kang wrote:
However, a selector is not a string. I was just listening to this
podcast
with Mike Ash, and he discusses this around the 9:23 mark or so:
On Oct 22, 2009, at 9:01 AM, Jens Alfke j...@mooseyard.com wrote:
This statement is true; however those integers happen to be the
memory addresses of unique instances of the strings*. This makes it
very efficient for the runtime to convert a selector to an NSString,
and vice versa, and
On Oct 22, 2009, at 10:53 AM, Bill Bumgarner wrote:
Selectors are strings, but it is an implementation detail.
The runtime uniques the strings such that there is only ever one
instance of, say, the drawRect: selector floating about. Thus,
the runtime can use pointer comparison to
On Oct 22, 2009, at 9:54 am, Jeff Johnson wrote:
Ignore bbum. We hereby promise never to break == for SEL. (But SEL is not
char*. We will break that.)
And now that it's on the mailing lists, it can be considered part of Apple's
official documentation. ;-)
It already is:
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)];
and for sending it to another class I've tried
[otherClass performSelector:@selector(doSomethingElse)];
But I just get an error in the Debugger
On Oct 21, 2009, at 12:23 PM, Joshua Garnham 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)];
and for sending it to another class I've tried
[otherClass
On Wed, Oct 21, 2009 at 9:23 AM, Joshua Garnham
joshua.garn...@yahoo.co.ukwrote:
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
.
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
On Oct 21, 2009, at 10:02, Shawn Erickson wrote:
But I just get an error in the Debugger saying
+[otherClass doSomethingElse]: unrecognized selector sent to class
0xe5c4
You are sending a message to an object that doesn't respond to that
message
(aka no implementation for it). The error
- Message from joshua.garn...@yahoo.co.uk -
but i get a warning in xcode, http://cld.ly/7c4la.
(JGManagedObject is what replaces otherClass)
That one is usually a case of not importing the JGManagedObject header
or not declaring the class method in that interface.
That selector is a unique index that points to a method of a specific class.
Methods themselves belong to a specific class and can't operate outside of
their classes. (They compile down to regular C functions that accept an
additional object parameter.)
So, it doesn't make sense to use one class's
Sent: Thursday, 22 October, 2009 6:21:29
Subject: Re: Sending a Selector to another Class.
On Oct 21, 2009, at 9:43 AM, Jim Kang wrote:
That selector is a unique index that points to a method of a specific class.
No, that's not true of Objective-C (although it is of C++ method-pointers
16 matches
Mail list logo