如何将int转换为无符号短int-iPhone

如何将int转换为无符号短int-iPhone,iphone,objective-c,int,unsigned,Iphone,Objective C,Int,Unsigned,我试图从plist中获取一个整数,并将其与sin\u port一起使用。但是,sin_port需要无符号短整数而不是int如何将int转换为无符号短整数 我不知道objective-c,但在普通c中,您可以执行以下操作 int value = 1234; unsigned short sin_port = (unsigned short) value;

我试图从plist中获取一个整数,并将其与
sin\u port
一起使用。但是,
sin_port
需要
无符号短整数
而不是
int
如何将
int
转换为
无符号短整数

我不知道objective-c,但在普通c中,您可以执行以下操作

int value = 1234;
unsigned short sin_port = (unsigned short) value;