From 7525dc28d7bebb061a2b8754295f46ffdb8eb340 Mon Sep 17 00:00:00 2001 From: apwelsh Date: Tue, 21 Mar 2017 22:26:16 -0700 Subject: [PATCH] Updated initWithCoder to correct implementation with proper initializer method The initWithCoder method is missing a call to [self init], so I modified the initWithCoder function to adhere to the standard initializer template. --- AutoCoding/AutoCoding.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AutoCoding/AutoCoding.m b/AutoCoding/AutoCoding.m index 5029ebb..452a54f 100644 --- a/AutoCoding/AutoCoding.m +++ b/AutoCoding/AutoCoding.m @@ -259,7 +259,10 @@ - (void)setWithCoder:(NSCoder *)aDecoder - (instancetype)initWithCoder:(NSCoder *)aDecoder { - [self setWithCoder:aDecoder]; + self = [self init]; + if (self) { + [self setWithCoder:aDecoder]; + } return self; }