• 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
Subclassing NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclassing NSString


  • Subject: Subclassing NSString
  • From: Brendan Younger <email@hidden>
  • Date: Sat, 16 Jun 2001 01:51:58 -0500

I've been having some difficulties subclassing NSString. Using the code that follows:

//ModelApp.h
@interface ModelAppObject : NSString
{
ProcessSerialNumber psn;
}

- (void)setPSN:(ProcessSerialNumber*)PSN;
@end

//Other.m
//also, char name[32] is a pascal string in case you were wondering...

[NSMutableArray addObject:[ModelAppObject stringWithCString:&(name[1]) length:name[0]]];

gives this run-time error:
-[ModelAppObject initWithBytes:length:encoding:]: selector not recognized

any ideas as to why?

Brendan Younger


  • Follow-Ups:
    • Re: Subclassing NSString
      • From: Andreas Monitzer <email@hidden>
  • Prev by Date: Re: Using C?
  • Next by Date: Re: Cocoa/EOF for non-enterprise apps Re: proof of cocoa
  • Previous by thread: Re: Cocoa/EOF for non-enterprise apps
  • Next by thread: Re: Subclassing NSString
  • Index(es):
    • Date
    • Thread