Constant String Objects - Red Hat ENTERPRISE LINUX 4 Manual

Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Chapter 8. GNU Objective-C runtime features
}
- initWithPointer:(const void*)p;
- (const void*)weakPointer;
@end
@implementation WeakPointer
+ (void)initialize
{
class_ivar_set_gcinvisible (self, "weakPointer", YES);
}
- initWithPointer:(const void*)p
{
weakPointer = p;
return self;
}
- (const void*)weakPointer
{
return weakPointer;
}
@end
Weak pointers are supported through a new type character specifier represented by the
The
class_ivar_set_gcinvisible()
description of the instance variable named as argument.

8.4. Constant string objects

GNU Objective-C provides constant string objects that are generated directly by the compiler. You
declare a constant string object by prefixing a C constant string with the character
id myString = @"this is a constant string object";
The constant string objects are by default instances of the
vided by the GNU Objective-C runtime. To get the definition of this class you must include the
objc/NXConstStr.h
User defined libraries may want to implement their own constant string class. To be able
to support them, the GNU Objective-C compiler provides a new command line options
-fconstant-string-class=
the same as
NXConstantString
@interface MyConstantStringClass
{
Class isa;
char *c_string;
unsigned int len;
}
@end
function adds or removes this specifier to the string type
header file.
class-name
's structure:
NXConstantString
. The provided class should adhere to a strict structure,
269
character.
!
:
@
class which is pro-

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents