Closed mustafa96m closed 7 years ago
Looks like code that you're running in a Realm write transaction is throwing that exception. Realm doesn't handle exceptions thrown by your code, you have to handle those yourself.
Please keep in mind that most Objective-C frameworks don't throw exceptions as control flow or runtime handlable error reporting, but rather to indicate programmer error or API misuse, so you should instead avoid the exception being thrown rather than catching it explicitly.
I debugged it after crash this what it's showing,
Looks fine. requestString, responseString can't be nil because I'm checking them first then proceed with inserting them to Realm.
Thanks for the reply.
Is there anything more we can help you with?
Thanks so much, though I'm a little bit confused correct me if I'm mistaken the exception is being thrown by AFNetworking @ this stack and got handled by realm right?
16 **** 0x000a9699 __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2.150 + 217
What makes you think that this is an exception being thrown, or that Realm is handling it?
Because of transactionWithBlock: has try-except right? this why it's catching the exception "Data parameter is nil"
Yet I couldn't identify why it's happening because it's really odd. I've tested on two devices requesting the same API same source yet one goes well the other crashes.
Because of transactionWithBlock: has try-except right?
No, we only catch exceptions thrown by Realm, not by anything in your code or the frameworks you call into.
So any idea where "Data parameter is nil" is coming from?
That's not being thrown by anything inside Realm.
Alright, Thanks.
Please open a new issue if you have any other problems. Thanks!
Hi guys,
I'm using realm as a caching db to cache responses and requests I created an realm object called Cache managed by singleton object called CacheManager which is used in Networking singleton object which is NetworkManager
Cache.h:
Cache.m:
Stacktrace
Console Output
Steps to Reproduce
requestString : id=2132132&color=3213213&block=Stringstringstring responseString : [Big json object as a string] [ 7,344 bytes ] cacheAPI : page.php
try to insert from singleton object.
Code Sample
Version of Realm and Tooling
Realm framework version:
Xcode version: 8.2.1
iOS/OSX version: 10.2.1
Dependency manager + version: Cocoapods