简体   繁体   中英

How do I add a subview to a view

I want to learn more about XCode, so I created an application that is intended for general desktop/laptop use, but not for iPhone.

It has AppController built on #include "Foundation/Foundation.h" and using files that I named AppController.h, AppController.m, and the MainMenu.xib file that was generated by the development system.

Now I want to add a subview. As I work though the problem, I'm obviously leaving out something or I'm incorrectly coding something. I can find many tutorials that provide a list of steps that are intended for iPhone applications, but none that fit my non-iPhone project.

Here's a chapter from Aaron Hillegass's book that shows how to do custom views and explains the view hierarchy.

There's also a "View Programing Guide" available on Apple's web site .

I'd very much recommend buying the physical book of "Cocoa Programming for Mac OS X" and going through each of the chapters and doing each of the practice apps. You might think it expensive, but it's absolutely worth every penny. It one of those resources I used way back when I wanted to become a hardcore Cocoa engineer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM