can anyone help me i am setting um pushwoosh and i am getting this error
/PushNotificationManager.m:43:111: Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'
can anyone help me i am setting um pushwoosh and i am getting this error
/PushNotificationManager.m:43:111: Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int'
NSInteger
has a larger size (equals long
) on 64bit systems than int
. The warning tells you, that you may loose information when transforming an NSInteger
to int
. You can suppress the warning by typecasting to (int)
, but then you may suddenly find strange calculations due to the precision loss. Better to use NSInteger
instead of int
for all integer variables. See also When to use NSInteger vs. int for some more discussion.
Implicit vs. explicit:
NSInteger myLong = 11234;
int myInt = myLong; // implicit
int myInt2 = (int)myLong; // explicit by typecasting; you should know why you do this.