From b41acb10e3f7371a5b2e1c2d2e31d919910122d6 Mon Sep 17 00:00:00 2001 From: Stig Brautaset Date: Sun, 10 Nov 2013 09:30:08 +0000 Subject: [PATCH] Use weak rather than unsafe_unretained (no longer support iOS < 5) --- SBJson.xcodeproj/project.pbxproj | 4 ---- src/main/objc/SBJsonStreamParser.h | 4 ++-- src/main/objc/SBJsonStreamParserAdapter.h | 2 +- src/main/objc/SBJsonStreamWriter.h | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/SBJson.xcodeproj/project.pbxproj b/SBJson.xcodeproj/project.pbxproj index 5ab359f7..0f3b8561 100644 --- a/SBJson.xcodeproj/project.pbxproj +++ b/SBJson.xcodeproj/project.pbxproj @@ -788,13 +788,11 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - DSTROOT = /tmp/sbjson_ios.dst; GCC_PREFIX_HEADER = "sbjson-ios/sbjson-ios-Prefix.pch"; HEADER_SEARCH_PATHS = ( include/, "$(BUILT_PRODUCTS_DIR)/usr/local/lib/include/", ); - IPHONEOS_DEPLOYMENT_TARGET = 4.3; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -808,10 +806,8 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - DSTROOT = /tmp/sbjson_ios.dst; GCC_PREFIX_HEADER = "sbjson-ios/sbjson-ios-Prefix.pch"; HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/include/"; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = include/SBJson/; diff --git a/src/main/objc/SBJsonStreamParser.h b/src/main/objc/SBJsonStreamParser.h index 915d11ab..b5821918 100644 --- a/src/main/objc/SBJsonStreamParser.h +++ b/src/main/objc/SBJsonStreamParser.h @@ -122,7 +122,7 @@ typedef enum { */ @interface SBJsonStreamParser : NSObject -@property (nonatomic, unsafe_unretained) SBJsonStreamParserState *state; // Private +@property (nonatomic, weak) SBJsonStreamParserState *state; // Private @property (nonatomic, readonly, strong) NSMutableArray *stateStack; // Private /** @@ -134,7 +134,7 @@ typedef enum { Usually this should be an instance of SBJsonStreamParserAdapter, but you can substitute your own implementation of the SBJsonStreamParserDelegate protocol if you need to. */ -@property (unsafe_unretained) id delegate; +@property (weak) id delegate; /** The max parse depth diff --git a/src/main/objc/SBJsonStreamParserAdapter.h b/src/main/objc/SBJsonStreamParserAdapter.h index a138f2fc..9caf8d8c 100644 --- a/src/main/objc/SBJsonStreamParserAdapter.h +++ b/src/main/objc/SBJsonStreamParserAdapter.h @@ -147,6 +147,6 @@ typedef enum { Your delegate object Set this to the object you want to receive the SBJsonStreamParserAdapterDelegate messages. */ -@property (unsafe_unretained) id delegate; +@property (weak) id delegate; @end diff --git a/src/main/objc/SBJsonStreamWriter.h b/src/main/objc/SBJsonStreamWriter.h index 7794a14f..112df960 100644 --- a/src/main/objc/SBJsonStreamWriter.h +++ b/src/main/objc/SBJsonStreamWriter.h @@ -101,14 +101,14 @@ NSMutableDictionary *cache; } -@property (nonatomic, unsafe_unretained) SBJsonStreamWriterState *state; // Internal +@property (nonatomic, weak) SBJsonStreamWriterState *state; // Internal @property (nonatomic, readonly, strong) NSMutableArray *stateStack; // Internal /** delegate to receive JSON output Delegate that will receive messages with output. */ -@property (unsafe_unretained) id delegate; +@property (weak) id delegate; /** The maximum recursing depth.