Re: NSConstantString? - solved
Re: NSConstantString? - solved
- Subject: Re: NSConstantString? - solved
- From: "Dr. H. Nikolaus Schaller" <email@hidden>
- Date: Thu, 24 Apr 2003 21:40:12 +0200
Hi Ben,
that (together with additional info found in a gcc discussion list) was
the right hint:
gcc checks for the following instance variables of the NSConstantString
class:
* a pointer (should be 'isa')
* a pointer (should be the char *, but can have any name/type!)
* an integer (can have any name)
* others may follow and are not checked
Many thanks,
Nikolaus
Am Mittwoch, 23.04.03 um 12:26 Uhr schrieb Ben Dougall:
"MYShortStringTest" from appendix b, from the downloadable code, from
www.cocoaprogramming.net might be helpful.
On Tuesday, April 22, 2003, at 10:14 pm, Dr. H. Nikolaus Schaller
wrote:
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.
+-------------------+
! 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.