Lately we are experiencing a lot of crashes on our client (ios devices, all using the latest SFS API [1.1.1]). When we run the application without attaching it to Xcode, these exceptions seems to be ignored. If we debug in Xcode however, the entire application crashes when the exception occurs. The annoying thing is that this happens very often! Is there a way to put this SFS function between inside a try-catch block to prevent the application from crashing and show a error message instead?
Do you guys also have any idea why this exception occurs?
Thanks!
Code: Select all
2012-10-25 11:13:41.939 ProjectX[34804:707] Uncaught EXCEPTION: Can't decode an SFSObject. Byte data is insufficient. Size: 0 byte(s)
2012-10-25 11:13:41.985 ProjectX[34804:707] Stack Trace: (
0 CoreFoundation 0x35d9e8a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x31717259 objc_exception_throw + 32
2 ProjectX 0x00112ef3 -[DefaultSFSDataSerializer binary2object:] + 162
3 ProjectX 0x00127c15 +[SFSObject newFromBinaryData:] + 80
4 ProjectX 0x0012a135 -[SFSProtocolCodec onPacketRead:] + 72
5 ProjectX 0x001265b3 -[SFSIOHandler handlePacketData:] + 890
6 ProjectX 0x00127383 -[SFSIOHandler onDataRead:] + 594
7 ProjectX 0x0013fedb -[UDPManager udpc:didReceiveData:fromAddress:] + 238
8 ProjectX 0x0013ea11 -[UDPController _readData] + 524
9 ProjectX 0x0013ee53 SocketReadCallback + 102
10 CoreFoundation 0x35d752ef __CFSocketPerformV0 + 638
11 CoreFoundation 0x35d72ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
12 CoreFoundation 0x35d72335 __CFRunLoopDoSources0 + 364
13 CoreFoundation 0x35d71045 __CFRunLoopRun + 652
14 CoreFoundation 0x35cf44a5 CFRunLoopRunSpecific + 300
15 CoreFoundation 0x35cf436d CFRunLoopRunInMode + 104
16 GraphicsServices 0x35a73439 GSEventRunModal + 136
17 UIKit 0x308cfe7d UIApplicationMain + 1080
18 ProjectX 0x00065903 main + 150
19 ProjectX 0x00065868 start + 40
)
2012-10-25 11:13:41.990 ProjectX[34804:707] *** Terminating app due to uncaught exception 'SFSCodecException', reason: 'Can't decode an SFSObject. Byte data is insufficient. Size: 0 byte(s)'
*** First throw call stack:
(0x35d9e88f 0x31717259 0x112ef3 0x127c15 0x12a135 0x1265b3 0x127383 0x13fedb 0x13ea11 0x13ee53 0x35d752ef 0x35d72ad3 0x35d72335 0x35d71045 0x35cf44a5 0x35cf436d 0x35a73439 0x308cfe7d 0x65903 0x65868)
terminate called throwing an exception(lldb)