Difference between CFMutableArray and NSMutableArray?

What is the difference between NSMutableArrayand CFMutableArray?

In which case (s) should we use one or the other?

+3
source share
3 answers

CFMutableArrayand NSMutableArrayare C- and Objective-C equivalents of the same type. They are considered a pair of "paid free bridges" type, which means that you can use CFMutableArrayReffor NSMutableArray*(and vice versa), and everything will work. The cases in which you will use one on top of the other are ease of use (are you using C or Objective-C?) Or compatibility with the API that you would like to use. See here for more details .

+14

. , - ( ) .

, .

CFMutableArrayRef - C NSMutableArray * - Objective-C

, - , , , objc.

, (sorta - , ) NSMutableArray objc.

+1

API- OSX , API-, , API-, , API- .

CFMutableArray CoreFoundation API . NSMutableArray ( , NS NextStep) Foundation API , AppKit Cocoa.

, , . , Cocoa, NSMutableArray - . , - , CoreFoundation, CFMutableArray.

, , CF/NS , API- CoreFoundation, , Cocoa .

+1

Source: https://habr.com/ru/post/1723187/