我是macosX开发的新手,我下载了一个开源的mac应用程序,但我无法理解cocoa程序的执行流程。所以任何人都可以简单地解释通用cocoa程序中的程序流程。
提前感谢
我是macosX开发的新手,我下载了一个开源的mac应用程序,但我无法理解cocoa程序的执行流程。所以任何人都可以简单地解释通用cocoa程序中的程序流程。
提前感谢
从main
开始。它不太可能包含任何有趣的内容,但值得检查一下,以防万一。很可能,它只包含对NSApplicationMain
的调用,该调用将创建NSApplication对象并向其发送运行
消息。这就是让应用程序运行的原因,而这个方法将在进程的其余部分运行。
然后查看MainMenu笔尖。加载这是应用程序要做的第一件事。这里任何设置为“启动时可见”的窗口都会立即出现;更重要的是,应用程序委托可能会在这里。检查应用程序的或文件所有者的(应用程序在此笔尖中同时存在,因此您需要同时检查两者)delegate
出口,如果其中一个已连接,请按照连接进行操作。查看该对象是哪个类的实例。
找到应用程序委托类后,在Xcode中打开它。浏览应用程序委托方法的列表,找到实现的方法,并读取实现的方法。应用程序:…完成启动:
双胞胎在进程开始时尤为重要。
从那里开始,一切都只是阅读代码,看看它做了什么,然后去它带你去的地方。
Peter的回答很好——我还想检查一下wakeFromNib的实现,尤其是从MainMenu.nib加载的对象。无论对错,你经常会发现这个方法中隐藏着有趣的东西。
I m using Xcode on OSX to develop command line C applications. I would also like to use Instruments to profile and find memory leaks. However, I couldn t find a way to display the console when ...
i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...
This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...
I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...
My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...
I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...
The problem I am trying to solve is quite simple. When I open the lid of my MacBook I like to have the Dock on the left side of the screen, but when I get home and connect my MacBook to my Cinema ...
A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...