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

NSConstantString?


  • Subject: NSConstantString?
  • From: "Dr. H. Nikolaus Schaller" <email@hidden>
  • Date: Tue, 22 Apr 2003 23:14:11 +0200

Dear all,
I am trying to modify the NSString class cluster (for educational purposes) and have some success.
But I constantly get an "interface `NSConstantString' lacks required ivars" error.

There is an article at http://developer.apple.com/techpubs/macosx/DeveloperTools/gcc3/gcc/ Constant-string-objects.html
that says, the instance variables are:

@interface NXConstantString : Object
{
char *c_string;
unsigned int len;
}
@end

but that seems to be valid for NXConstantString only (which is the standard gcc default). Apple gcc in the developer tools
seems to default to NSConstantString.

Runtime browser suggests to use

@interface NSSimpleCString : NSString
{
char *bytes;
unsigned int numBytes;
}

But it gives the above mentioned error message.

My code is as follows:

@interface NSString : NSObject {
unichar *_data;
unsigned int _length;
BOOL _freeWhenDone;
int _hash;
}

@interface NSSimpleCString : NSString
{
char *bytes;
unsigned int numBytes;
}
@end

@interface NSConstantString : NSSimpleCString
{
}
@end

extern void *_NSConstantStringClassReference; // this also removes a warning message


Any ideas, hints, thoughts? Many thanks,
Nikolaus

+-------------------+
! email@hidden !
+-------------------+
_______________________________________________
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.

  • Prev by Date: mail.app
  • Next by Date: Re: outlet initialization
  • Previous by thread: mail.app
  • Next by thread: Debugging distributed objects
  • Index(es):
    • Date
    • Thread