I was wondering if there was a way to catch the NSInvalidArgument error that is thrown when a NSExpression is invalid; such as: “4+”.
I have trying doing a guard, if let, but both seem to fail and the exception is still thrown. I know that there will be cases that the error will be thrown and I don’t want the app to crash each time - there’s no way to prevent it.
Any help is greatly appreciated. I did see that you can do it in Objective-C but I couldn’t find a good tutorial or explanation on how to create the header files for Swift.