-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in NSArray #322
Comments
As you can see in the debug log it found an NSDictionary where it expected an Array. |
we have one object which have array of object...as you can see in screen shot I'm simply using EVReflection pod to convert json to our class object...CountryRateDataModel has array of object. class CountryRateModel: EVObject { I don't know why it found NSDictornary...perhaps when array is empty then it is not being handled properly by EVReflection class.Also this crash is not happening everytime..but it is reported sometimes in my live application and affecting the performance. |
I don't seen an array definition in you class. Most fields are strings. 2 are sub objects. The bool should be defined an other way. see the readme about booleans. There are various ways to define an array, please show me your class definition that includes the array. |
That looks OK. If you also have a Json that is causing the error, then I could create a unit test to see what's going on and reproduce the issue and maybe fix it. Besides that, are you sure the Bool() value works? |
Yes Bool() does work...please find json response. { |
Hello, Is there any update? Are you able to reproduce the crash based on this JSON? Let me know if you have made any updates so I can update the pods? |
Hello,
I'm getting this crash sometimes. I am not able to reproduce this everytime.
if theValue is Array {
return (theValue as AnyObject, valueType, false)
}
Precondition failed: NSArray element failed to match the Swift Array Element type
Expected CountryRatesDetailModel but found __NSDictionaryI: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1100.2.280/swift/stdlib/public/core/ArrayBuffer.swift, line 354
2021-01-04 11:33:13.527870+0530[8041:61326] Precondition failed: NSArray element failed to match the Swift Array Element type
Expected CountryRatesDetailModel but found __NSDictionaryI: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1100.2.280/swift/stdlib/public/core/ArrayBuffer.swift, line 354
2021-01-04 11:35:39.520740+0530[8041:62506] XPC connection interrupted
The text was updated successfully, but these errors were encountered: