Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting CFIndex to NSInteger

This question is similar to mine, but does not contain an answer. I want to convert a CFIndex into an NSInteger. I have checked the list of types that have toll-free bridging and this is not one of them.

like image 370
pasawaya Avatar asked Feb 19 '26 04:02

pasawaya


1 Answers

The concept of toll-free bridging only applies to Objective-C objects and Core Foundation objects. CFIndex is simply a typedef for the primitive signed long type, and NSInteger is a typedef for the primitive long type, which is the same as signed long. You can just assign a value of one type to a variable of the other type.

like image 199
rob mayoff Avatar answered Feb 21 '26 13:02

rob mayoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!