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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift