From 917afb369275a0ec35db023d5b1bedd78a2e0734 Mon Sep 17 00:00:00 2001 From: Justin Walgran Date: Tue, 18 Oct 2016 13:15:31 -0700 Subject: [PATCH] Change property attributes on OTMPreferences The app was crashing with an `EXC_BAD_ACCESS` exception when the app delegate's `applicationDidEnterBackground:` method attempted to call `save` on `OTMPreferences`. Setting a breakpoint on unhandled exceptions revealed that the value of the `instance` property was invalid. It looks like this is the result of using the `assign` attribute, which should only be used on primitive types (int, BOOL, etc.). I am not able to reproduce the exception after replacing `assign` with our app-wide convention for string properties, `nonatomic` and `strong`. --- OpenTreeMap/src/OTM/OTMPreferences.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenTreeMap/src/OTM/OTMPreferences.h b/OpenTreeMap/src/OTM/OTMPreferences.h index 66f3f4b..188d348 100644 --- a/OpenTreeMap/src/OTM/OTMPreferences.h +++ b/OpenTreeMap/src/OTM/OTMPreferences.h @@ -19,7 +19,7 @@ + (OTMPreferences *)sharedPreferences; -@property (assign) NSString *instance; +@property (nonatomic, strong) NSString *instance; - (void)save; - (void)load;