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

How to blink a button iOS swift?

iOS flutter while run to iPhone it had the error - Cannot find type 'PhoneNumberKit' in scope