What Cocoa/Core Foundation helper functions do you wish you knew about 2 years ago?

前端 未结 7 1166
自闭症患者
自闭症患者 2021-01-31 00:20

I just discovered the NSRect helper functions in NSGeometry.h (i.e. NSMidX, NSMaxX, etc...)

These would have made some repetitive coding much easier. I knew about NSMak

7条回答
  •  耶瑟儿~
    2021-01-31 00:57

    Much of the stuff in NSPathUtilities.h. I did know about it two years ago, but when I first found it I wished I’d seen it two years earlier. :-)

    At some point I wasted quite a bit of time because I didn’t know about NSCountedSet, and made a mess of my dictionary-based replacement. I know of several cases where people have done the same sort of thing because they didn’t know about NSSet at all. Another good “hidden” collection is CFBinaryHeap, which implements a priority queue, but doesn’t have an NS equivalent.

提交回复
热议问题