Hi Stack Overflow,
got a quick question for you (pretty much the title): is the book Cocoa Programming for Mac OS X (3rd Edition) outdated?
It's just that I read a little in it, until page 36 (in a .PDF ebook version) where I came across a problem. The chapter introduces you to Objective-C and Cocoa, and you already have to write a program by yourself. Exciting. But when he makes a class called Foo.h and Foo.m, my Xcode doesn't follow the guide.
- His Interface Builder is different from my Interface Builder.
- When he is about to make outlets and actions, I can't do it. They just won't show up.
I am sure I entered the correct info in my Foo.h file:
#import <Cocoa/Cocoa.h>
@interface Foo : NSObject {
IBOutlet NSTextField *textField;
}
-(IBAction)seed:(id)sender;
-(IBAction)generate:(id)sender;
@end
the Foo.m file:
#import "Foo.h"
@implementation Foo
@end
and I dragged them both to the "Class" folder, but it still won't show them in IB. Besides that, Xcode shows three warnings:
- Incomplete implementation of class 'Foo'
- Method definition for '-generate:' not found
- Method definition for '-seed:' not found
This is why I think the book is outdated, but these are not errors, just warnings.
Here's some screenies:
This just made me think that the book might be outdated, and if I can use it all (if there are mistakes in every chapters). Is it me that made a stupid mistake, or is the book really outdated?
Please help me out on this one, as I really want to learn Objective-C and Cocoa :) Thank you.