@@ -64,20 +64,20 @@ freeWhenDone: (bool)freeWhenDone { OF_UNRECOGNIZED_SELECTOR } -- init +- (instancetype)init { self = [super of_init]; _itemSize = 1; return self; } -- initWithItemSize: (size_t)itemSize +- (instancetype)initWithItemSize: (size_t)itemSize { self = [super of_init]; @try { if (itemSize == 0) @@ -90,18 +90,18 @@ } return self; } -- initWithCapacity: (size_t)capacity +- (instancetype)initWithCapacity: (size_t)capacity { return [self initWithItemSize: 1 capacity: capacity]; } -- initWithItemSize: (size_t)itemSize - capacity: (size_t)capacity +- (instancetype)initWithItemSize: (size_t)itemSize + capacity: (size_t)capacity { self = [super of_init]; @try { if (itemSize == 0) @@ -118,13 +118,13 @@ } return self; } -- initWithItems: (const void *)items - itemSize: (size_t)itemSize - count: (size_t)count +- (instancetype)initWithItems: (const void *)items + itemSize: (size_t)itemSize + count: (size_t)count { self = [super initWithItems: items itemSize: itemSize count: count]; @@ -131,26 +131,26 @@ _capacity = _count; return self; } -- initWithItemsNoCopy: (const void *)items - count: (size_t)count - freeWhenDone: (bool)freeWhenDone +- (instancetype)initWithItemsNoCopy: (const void *)items + count: (size_t)count + freeWhenDone: (bool)freeWhenDone { OF_INVALID_INIT_METHOD } -- initWithItemsNoCopy: (const void *)items - itemSize: (size_t)itemSize - count: (size_t)count - freeWhenDone: (bool)freeWhenDone +- (instancetype)initWithItemsNoCopy: (const void *)items + itemSize: (size_t)itemSize + count: (size_t)count + freeWhenDone: (bool)freeWhenDone { OF_INVALID_INIT_METHOD } -- initWithStringRepresentation: (OFString *)string +- (instancetype)initWithStringRepresentation: (OFString *)string { self = [super initWithStringRepresentation: string]; _capacity = _count; @@ -285,11 +285,11 @@ _items = NULL; _count = 0; _capacity = 0; } -- copy +- (id)copy { return [[OFData alloc] initWithItems: _items itemSize: _itemSize count: _count]; }