1. Menu File - > New Project
2. Choose Cocoa Application
3. Set the name
4. Press Finish.
5. Choose Classes.
6. Popup menu -> Add File
7. Choose Objective-C class.
8. Set the class name (for example, Controller).
9. Open Resources.
10. Open MainMenu.nib
12. Open Library (Shift + Cmd + L).
13. Find NSObject and drag it to the MainMenu.nib document.
14. Select Controller.h file.
15. Drag the file to the open MainMenu.nib document (a plus sign in a circle will appear). Release the mouse button.
16. Select the added NSObject in the MainMenu.nib.
17. Open Inspector (Shift + Cmd + I).
18. Select last page (with "i" in a circle, in the right-up corner of the Inspector).
19. In the Class text field type the Controller class name (Controller in this example).
20. Click on another field in the Inspector and check the the object (NSObject) in the resources changed the name - now it's named Controller (the class name added in safe 8).
Now add controls, add IBOutlet and IBAction...
In Xcode 3.1.3 and 3.1.4 tis scenario works fine. Known tutorials do not explain the trick with NSObject dragged to the resources.
No comments:
Post a Comment