Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Chapter 11: Outlets for ColorBlendViews

In Chapter 11, on page 232, the book says "You need to Ctrl-drag from the MyDocument icon in the nib window to each of the ColorBlendViews ..."

But there is no MyDocument icon in the nib window (actually a xib window in my case; I'm using XCode 2.3.2). The first time I created this project, I added a MyDocument icon to the nib window by finding that class in the Library window. This worked for creating an environment where I could Ctrl-drag the outlets, but the final project failed. None of the ColorBlendViews instantiated properly.

When I did the project a second time, I found that the outlets are all in the "File's Owner" icon in the MyDocument nib window. Then everything worked. 

I hope this helps anyone else who might be working on this project.

Mark

Comments

  • Thanks for pointing this out! We'll make sure this is straightened out in the new edition.
  • 2013 July 17
    Concerning Learn Cocoa on the Mac, second edition

    Hello,

    Below I include the file 

    //  DungeonThingAppDelegate.h

    from the source code accompanying the text book. In subsection 

    "Making the Code Bindings-Ready" of chapter 7
     
    a part of the code for DungeonThingAppDelegate.h contains the lines

    @property (weak) IBOutlet NSTextField *characterLabel;
    @property (weak) IBOutlet NSTextField *monsterLabel;
    @property (weak) IBOutlet NSTextField *dungeonLabel;
    You do not find these lines in the source code below. Why?


    //
    //  DungeonThingAppDelegate.h
    //  DungeonThing
    //
    //  Created by Peter Clark on 7/24/12.
    //  Copyright (c) 2012 Learn Cocoa. All rights reserved.
    //

    #import <Cocoa/Cocoa.h>

    @interface DungeonThingAppDelegate : NSObject <NSApplicationDelegate>

    // add these:
    @property (strongNSMutableDictionary *characters;
    @property (strongNSMutableDictionary *monsters;
    @property (strongNSMutableDictionary *dungeons;

    @property (weakIBOutlet NSArrayController *characterArrayController;
    @property (weakIBOutlet NSArrayController *monsterArrayController;
    @property (weakIBOutlet NSArrayController *dungeonArrayController;

    @property (assignIBOutlet NSWindow *window;

    - (IBAction)createCharacter:(id)sender;
    - (IBAction)createMonster:(id)sender;
    - (IBAction)createDungeon:(id)sender;


    Thanks,
    Matz
Sign In or Register to comment.