ios - "Implicit conversion loses integer precision" while getting random numbers -


my plan random members of array, therefore, tried solution which, firstly, generate random number:

nsuinteger rnd = arc4random_uniform([myarray count]); 

however, got warning "implicit conversion loses integer precision".

how work around warning? there way random value won't cause warnings? prefer code implementations, not through settings several answers similar questions suggest.

just change code following :

nsuinteger rnd = arc4random_uniform((uint32_t) [myarray count]); 

the compiler gave warning on machine, nsuinteger typedef of 64 bits, may not case other devices. therefore, casting it, removes warning.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -