Files
kotlin-fork/native/native.tests/testData/interop/objc/tests/customString.m
T
2024-01-31 16:17:21 +00:00

32 lines
573 B
Objective-C
Vendored

#import "customString.h"
BOOL customStringDeallocated = NO;
@implementation CustomString {
NSString* delegate;
}
- (instancetype)initWithValue:(int)value {
if (self = [super init]) {
self->delegate = @(value).description;
self.value = value;
}
return self;
}
- (unichar)characterAtIndex:(NSUInteger)index {
return [self->delegate characterAtIndex:index];
}
- (NSUInteger)length {
return self->delegate.length;
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (void)dealloc {
customStringDeallocated = YES;
}
@end