I was playing around with the first simple windowing example in the oreilly cocoa book. The example simply contains a text field and the programmer adds a subclass of NSObject to "control" the text field. The end result is the date, displayed in the text field. Anyways, the interface builder creates some skeleton obj-c and header file. In the header file there is a something like (I don't have the code right now, it's on my home computer):
IBOutlet id textField;
and the book recommends changing the type of textField to reflect the fact that it's an NSTextField. Well, when I do that the compiler complains that it can't statically allocate the object. If I leave the code as it's generated by interface builder, then it works fine. Why doesn't this work? Sorry I can't type the exact error of the compiler, but my connection at home is down right now, but it's all in the cocoa book, for those that have it.
Thanks,
Anthony
IBOutlet id textField;
and the book recommends changing the type of textField to reflect the fact that it's an NSTextField. Well, when I do that the compiler complains that it can't statically allocate the object. If I leave the code as it's generated by interface builder, then it works fine. Why doesn't this work? Sorry I can't type the exact error of the compiler, but my connection at home is down right now, but it's all in the cocoa book, for those that have it.
Thanks,
Anthony