Old version of sbjson throw exception in iOS 10

91 views Asked by At

My problem is about coding in old version of sbjson, there are some code which caused exception in iOS 10.3.3 compiled in XCode 8.3.3.

Update to new version of sbjson might work but since i am maintaining the iOS app, i don't want to change too much on the source code of the application.

In the old version, the class [SBJsonStreamParser.h] and [SBJsonStreamWriter.h] have code which define the @property of [SBJsonStreamParserState *state], [SBJsonStreamWriterState *state] as (nonatomic, assign) follow by a manual retain release setting [__weak],

which cause the error:

Unsafe_unretained property 'status' may not also be declared __weak

May i ask if it'll work fine if i just comment out the 'assign' setting of property, hence:

@property (nonatomic /* , assign*/) __weak SBJsonStreamWriterState *state

Thanks a lot for the help

1

There are 1 answers

0
Stig Brautaset On

I don't think it was possible to use weak as a property modifier back when I wrote that, but the following might work now:

@property (nonatomic, weak) SBJsonStreamWriterState *state