swift - How to cast from UInt16 to NSNumber -


i have uint16 variable pass legacy function requires nsnumber.

if try:

var castasnsnumber : nsnumber = myuint16 

i compiler error 'uint16' not convertible 'nsnumber'

question

how can recast nsnumber?

var castasnsnumber = nsnumber(unsignedshort: myuint16) 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -