ObjFW  Diff

Differences From Artifact [daaae842d6]:

To Artifact [466d9af03d]:


125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
}
@end

@implementation OFData
+ (void)initialize
{
	if (self == [OFData class])
		placeholder.isa = [OFDataPlaceholder class];
}

+ (instancetype)alloc
{
	if (self == [OFData class])
		return (id)&placeholder;








|







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
}
@end

@implementation OFData
+ (void)initialize
{
	if (self == [OFData class])
		object_setClass((id)&placeholder, [OFDataPlaceholder class]);
}

+ (instancetype)alloc
{
	if (self == [OFData class])
		return (id)&placeholder;

205
206
207
208
209
210
211
212

213
214
215
216
217
218
219
+ (instancetype)dataWithBase64EncodedString: (OFString *)string
{
	return [[[self alloc] initWithBase64EncodedString: string] autorelease];
}

- (instancetype)init
{
	if ([self isMemberOfClass: [OFData class]]) {

		@try {
			[self doesNotRecognizeSelector: _cmd];
		} @catch (id e) {
			[self release];
			@throw e;
		}








|
>







205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
+ (instancetype)dataWithBase64EncodedString: (OFString *)string
{
	return [[[self alloc] initWithBase64EncodedString: string] autorelease];
}

- (instancetype)init
{
	if ([self isMemberOfClass: [OFData class]] ||
	    [self isMemberOfClass: [OFMutableData class]]) {
		@try {
			[self doesNotRecognizeSelector: _cmd];
		} @catch (id e) {
			[self release];
			@throw e;
		}