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

store cgpoint in userdefaults iOS swift

libc++abi: terminating due to uncaught exception of type NSException iOS swift