Convert String to NSNumber iOS Swift



We cannot convert string directly to NSNumber.So we will convert string to Int then convert Int to NSNumber.

Code:
          NSNumber(value: Int("String")!)

Comments

Post a Comment

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