3

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.

Community
  • 1
  • 1
pasawaya
  • 11,515
  • 7
  • 53
  • 92

1 Answers1

14

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.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848