SkygearIO / skygear-SDK-iOS

Skygear SDK for iOS
https://skygear.io
Other
10 stars 28 forks source link

Crash when use SKYRecordStorage to save a record that contains SKYSequence #28

Closed a821246710 closed 8 years ago

a821246710 commented 8 years ago

error message:

-[SKYSequence encodeWithCoder:]: unrecognized selector sent to instance 0x7fc9236d42e0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SKYSequence encodeWithCoder:]: unrecognized selector sent to instance 0x7fc9236d42e0'

code:

let todo = SKYRecord(recordType: "todo")
todo.setObject(title!, forKey: "title")
todo.setObject(SKYSequence(), forKey: "order")
todo.setObject(false, forKey: "done")

self.recordStorage.saveRecord(todo)
cheungpat commented 8 years ago

While SKYRecordStorage should not crash saving SKYSequence, it probably won’t be sortable, since the value is entirely dependent on server-side state.

cheungpat commented 8 years ago

I am not sure why this is happening... can you give me a stack trace or a branch of your code repo so that I can reproduce this? I tried reproducing this but unsuccessful.

cheungpat commented 8 years ago

Something like this:

screen shot 2016-08-23 at 12 42 46 pm

see also https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html

a821246710 commented 8 years ago

you may could try this? https://github.com/a821246710/swift-todo/tree/local-storage