Fig 16.7 Way to see a Class's implementation .m file?


#1

In Figure 16.7 we see that by Command Clicking on a Class such as “NSMutbleArray” we can see the file where a built-in class is declared.

Is there any way within xCode to see the class’s corresponding implementation *.m file.

I would like to see what is under the hood with some of these Classes and their methods but so far I haven’t found a way to examine them.

…Dale


#2

Unfortunately, and for good reasons, no.


#3

What’s the good reason? So we can’t change them? I don’t want to change them. I’d be delighted if we could see them in a locked-down, view-only state.


#4

For example, I’m in Chapter 7 of the other book (iOS Programming) - I’m reading both books concurrently.

In that chapter it says that UITabViewController switches the apps two views. Well, I’d like to see how that is done under the hood because I’d like to write my own baseViewController to swtich between views in a way that is different than all the built in view controllers.

…Dale


#5

Apple considers the .m files of the standard libraries to be valuable intellectual material. They are kept in a vault a mile beneath Cupertino. Similarly, Microsoft keeps the source code to the .net libraries buried deep beneath their building.


#6

Thanks Aaron. That’s what I suspected.

Back to my hunt … I just want a simple two view app that I can click the button on the top to spin the view to the other view. UITabBarController does this under the hood. I don’t want a two switch UITabBar taking up precious realestate on the bottom of the screen. I’m going to have other buttons on the bottom of the screen (ie: each screen will have tables and I want to have sort buttons for those tables on the bottom of the screen). I started to write this app three years ago and never quite figured it out. I came back month ago and am still on the hunt. I know I need to write my own RootViewController that has methods that switch the views when I click on the buttons in the other two subViews of my RootViewController but for the life of me I can’t figure this out. I peeked ahead in the two books and neither shows how this can be done. I get endless errors when i try every way I can think of. I’ve purchased other texts and none of them show me either. I found a sample years ago that pulls this off by creating all the views programatically. I don’t want want that. I want to create the views with interface builder and then just switch back and forth between the views.

Dang, if only I could look under the UiTabViewController hood! :slight_smile:

…Dale


#7

Aaron, out of pure interest if we have access to the header files it means that the .m files are within the framework / library. So if someone really wanted access to them - could they not devote all their time to getting to those files (Hacking or whatever) - otherwise how does xCode know how to implement them?


#8

Xcode does not implement them; it just links your compiled code (its object code) with the object code residing in the libraries/frameworks. (Basically, Apple provides only the header files and the object libraries.) You could try reverse engineering from the object code, but that would be like going near a black hole!


#9

Thanks bex for the clarification.