29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#import "unicode.h"
static struct {
Class isa;
} placeholder;
@interface OFMutableStringPlaceholder: OFMutableString
@end
@implementation OFMutableStringPlaceholder
- (instancetype)init
{
return (id)[[OFMutableUTF8String alloc] init];
}
- (instancetype)initWithUTF8String: (const char *)UTF8String
{
|
|
|
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#import "unicode.h"
static struct {
Class isa;
} placeholder;
@interface OFPlaceholderMutableString: OFMutableString
@end
@implementation OFPlaceholderMutableString
- (instancetype)init
{
return (id)[[OFMutableUTF8String alloc] init];
}
- (instancetype)initWithUTF8String: (const char *)UTF8String
{
|
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
@end
@implementation OFMutableString
+ (void)initialize
{
if (self == [OFMutableString class])
object_setClass((id)&placeholder,
[OFMutableStringPlaceholder class]);
}
+ (instancetype)alloc
{
if (self == [OFMutableString class])
return (id)&placeholder;
|
|
|
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
@end
@implementation OFMutableString
+ (void)initialize
{
if (self == [OFMutableString class])
object_setClass((id)&placeholder,
[OFPlaceholderMutableString class]);
}
+ (instancetype)alloc
{
if (self == [OFMutableString class])
return (id)&placeholder;
|