Skip to content

Commit

Permalink
Use weak rather than unsafe_unretained (no longer support iOS < 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
stig committed Nov 10, 2013
1 parent 038f396 commit b41acb1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions SBJson.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
Expand All @@ -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/;
Expand Down
4 changes: 2 additions & 2 deletions src/main/objc/SBJsonStreamParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand All @@ -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<SBJsonStreamParserDelegate> delegate;
@property (weak) id<SBJsonStreamParserDelegate> delegate;

/**
The max parse depth
Expand Down
2 changes: 1 addition & 1 deletion src/main/objc/SBJsonStreamParserAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SBJsonStreamParserAdapterDelegate> delegate;
@property (weak) id<SBJsonStreamParserAdapterDelegate> delegate;

@end
4 changes: 2 additions & 2 deletions src/main/objc/SBJsonStreamWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SBJsonStreamWriterDelegate> delegate;
@property (weak) id<SBJsonStreamWriterDelegate> delegate;

/**
The maximum recursing depth.
Expand Down

0 comments on commit b41acb1

Please sign in to comment.