NSNumber predicate in iOS swift

 Problem:

I want to filter NsNumber entries in core data. So i tried to use predicate with %@ but it crashes the app.

How to solve that?

Solution:

                        let datePredicate = NSPredicate(format"date.integerValue <= %@",selectedDate)

                        let filtered = dataArray.filtered(using: datePredicate)


It will works fine 


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift