Closed webmaster100 closed 7 years ago
This usually happens because your app was unable to create the managed object model. Probably because it couldn't find the managed object model file, Mobile Buy SDK.xcdatamodeld
, in the bundle. Possibly because you didn't include the SDK resources bundle in your target.
In the code you show there, the problem is that block(obj)
is returning nil
. If you step into that block (defined in +[BUYModelManager buy_objectsWithEntityName:JSONArray:]
, you'd see that the cls
variable is probably nil
, so object instantiation fails. cls
is nil because the model manager's model
property is nil
. Basically, you have a cascade of nil
values.
You will have to trace it back to be sure, however.
I have installed the mobile-buy-sdk-ios using Cocoapods and as I see it automatically connects the resources. It is the only place where I found it in the workspace in Xcode The cls variable have the value: Can be there some product parsing error? It is one of the product in the response: <__NSArrayI 0x6000003a4600>( { available = 1; "body_html" = "
Condition: Barely Used
\nPersonal Note:
\n<p style=\"padding-left: 30px;\">\"not specified\"\nYour screenshot clearly shows cls
== 0x0
, in other words, Nil
(I incorrectly said nil
before). cls
should be a class object. Without that, [cls alloc]
is nil
. So there's no reason that I can see to suspect a parsing error.
If there was a parsing error, it would be in Apple's JSON deserialization, but in that case, you would have seen an error logged to the console and nil
returned instead of a dictionary. You should be able to easily verify that. In terms of mapping the dictionary contents to a new object, even if that failed for some reason, you would still get a new object returned, but it's properties would not have the right values.
The error was fixed when I copied by reference the datamodel file to Compile Sources as mentioned in this thread Thank you!
@webmaster100 Hello Sir, You have idea in WebCheckout and Shipping rates ?
@JaydeepPatel, Hello, I used react-native-shopify package for webcheckout and getting shipping rates.
Hi, I want to use the mobile-buy-sdk-ios with react-native-shopify. When calling methods getProducts(1) and getCollections(1) the products and collections are returned from the requests, but some parsing error occurs after that. The error seems to occur after this line: Can you advise what causes this error and how can I resolve it? Thank you!