pasawaya
pasawaya

Reputation: 11595

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.

Upvotes: 3

Views: 3303

Answers (1)

rob mayoff
rob mayoff

Reputation: 385970

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.

Upvotes: 14

Related Questions