问题
I can find the UIKit header files but i'd like to see how some of the UIKit classes are being implemented because i'm trying to create some custom controls.
So basically i'm trying to find the UIKit .m files, where would they be located on my mac?
回答1:
They aren't on your Mac (in source form). Only Apple has access to most UIKit source. What you have on your Mac is already compiled into library binary files.
回答2:
The source code (as hotpaw2 said) is only available to Apple, but there are multiple ways you can see what's going on:
- Using the program class-dump (example output for UIKit: https://github.com/kennytm/iphone-private-frameworks/tree/master/UIKit/ ), you can view all the private methods and instance variables of the UIKit classes, to see how they implement them at a higher level.
- Disassemblers, like IDA Pro ( http://hex-rays.com/ ) can disassemble and read the assembly-level code for the classes, although this is much lower level than is often useful.
So, while it's not as simple as opening up some .m files, it's certainly possible to see how Apple does things in UIKit!
来源:https://stackoverflow.com/questions/4181024/where-are-the-uikit-framework-implementation-files-located