This code is a modified version of the Tempered Dictionary implemented here.
https://github.com/nicklockwood/OrderedDictionary/tree/master/OrderedDictionary
Interface -> OrderedDictionary.h
@interface OrderedDictionary : NSMutableDictionary
{
}
Implementation -> OrderedDictionary.m
- (instancetype)init
{
return [self initWithCapacity:0];
}
- (instancetype)initWithCapacity:(NSUInteger)capacity
{
self = [super init];
if (self != nil)
{
}
return self;
}
The code works fine, but I get the following warnings in "- (instancetype) init".
- A designated initializer should only call a designated initializer on 'super'
- The designated initializer skips the "super" call the designated initializer of the superclass
What am I doing wrong and how to fix it?
The following code changes have been made to resolve the issue.
- (instancetype)init
{
self = [super init];
if (self != nil)
{
}
return self;
}
- (instancetype)initWithCapacity:(NSUInteger)capacity
{
self = [super initWithCapacity:capacity];
if (self != nil)
{
}
return self;
}