• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: +[NSConstantString length]: selector not recognized
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: +[NSConstantString length]: selector not recognized


  • Subject: Re: +[NSConstantString length]: selector not recognized
  • From: Karl Kraft <email@hidden>
  • Date: Fri, 14 Mar 2003 08:52:51 -0800

On Thursday, March 13, 2003, at 06:31 PM, Jonathan Jackel wrote:

What is the declaration of the method that is performing these commands?
Post the whole code for the class and I could solve it.

I'm running into a strange problem with some strings.
Here's what I'm doing. In some method I have:
NSMutableString *right = [[[bothSides objectAtIndex:1] mutableCopy]
autorelease];
Which returns a valid mutable string. Then I do:
NSString *newRight = [NSString stringWithString:right];
NSString *createArg = [NSString stringWithFormat:@"[Right]
:%@",newRight];
NSArray *nothing = [self create:createArg array:picks];




And up until this point everything seems ok. createArg contains
something like "[Right] :Things" -- no apparent problems.
The beginning of create:array: looks like this:
- (NSArray *)create:(NSString *)arguments array:(NSArray *)picks
{
NSArray *args = [arguments componentsSeparatedByString:@":"];


Break in the debugger and se what arguments is. Do you have an arguments instance variable that perhaps it is using instead and is uninitialized? Is self a pointer to an instance of your class, or your class itself? If the first code you have above is a class method, than self here would be the class and not the instance, and arguments would also be a class not an instance, and you would probably throw an exception for selector not recognized.

And this is where the fun starts. As soon as I hit this statement, I
get:

2003-03-13 21:10:33.004 DGStitcher[1187] *** +[NSConstantString
length]: selector not recognized

It threw an exception, and since you weren't catching them it goes up to the default handler which prints this.

Instances of NSConstantString should respond to length
The Class of NSConstantString does not.

The +[NSConstantString means that the length method is being sent to the class and not to an instance.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • RE: +[NSConstantString length]: selector not recognized
      • From: "Jonathan E. Jackel" <email@hidden>
References: 
 >+[NSConstantString length]: selector not recognized (From: Jonathan Jackel <email@hidden>)

  • Prev by Date: Documents Alias
  • Next by Date: Re: anoncvs.opensource.apple.com CVS server dead?
  • Previous by thread: +[NSConstantString length]: selector not recognized
  • Next by thread: RE: +[NSConstantString length]: selector not recognized
  • Index(es):
    • Date
    • Thread