0

Any ideas how to "retain" CGPDFDictionaryRef? CFRetain not working, but there must be way to "retain" it.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
RolandasR
  • 3,030
  • 2
  • 25
  • 26

2 Answers2

3

From the documentation

This opaque type is not derived from CFType and therefore there are no functions for retaining and releasing it. CGPDFDictionary objects exist only as constituent parts of a CGPDFDocument object, and they are managed by their container.

Joshua Weinberg
  • 28,598
  • 2
  • 97
  • 90
0

A CGPDFDictionaryRef is just a pointer to a struct. Thus, you can easily retain it when boxed into a NSValue.

Of course the object parent container (CGPDFDocument and CGPDFPage) need to be kept in memory or the pointers within the struct will go invalid.

steipete
  • 7,581
  • 5
  • 47
  • 81