How to make an CFArrayRef to an NSMutableArray

后端 未结 2 504
醉酒成梦
醉酒成梦 2020-12-21 03:49

This is my Code to create the CFArrayRef. I want to know how to make it to an NSMutableArray. I need it for my TableViewController. Or is there another way to use the CFArra

相关标签:
2条回答
  • 2020-12-21 03:53

    A CFArrayRef is toll-free bridged to NSArray *, so you can cast it as such and then create a mutable copy:

    NSMutableArray *data = [(NSArray *) myCFArrayRef mutableCopy];
    
    0 讨论(0)
  • 2020-12-21 04:17

    For an autoreleased version, use

    NSMutableArray* data = [NSMutableArray arrayWithArray: (NSArray*) myCFArrayRef];
    
    0 讨论(0)
提交回复
热议问题