Background
- Parse 1.8.5 iOS SDK
- Xcode 7.0.1 (7A1001)
- Swift 2
In my code, I subclassed PFUser (named as MyUser), and try to create the query using MyUser.query()
. It returns me PFQuery?
let query = MyUser.query()
query!.whereKey("username", containedIn: ["a", "b"])
query!.findObjectsInBackgroundWithBlock({ (objects, error) -> Void in
...
})
I then submitted this to App Store Review, and being rejected 4 times (taking me 4 weeks), and they kept reporting the app crashes around here. It's been very frustrating. After checking with Crashlytics, it says the below line is raising EXC_BREAKPOINT
.
query!.whereKey("username", containedIn: ["a", "b"])
The crash log from Apple says it is EXC_BREAKPOINT (SIGTRAP)
, that implies a non-optional type with a nil value
according to TN2151. In fact the symbolicated version of the crash logs provided by Apple shows line number to be 0.
I checked Parse documentation, the returned PFQuery
is not optional. I wonder what is the best practice to implement this logic.