I am coming from the c++ world and I feel I don't understand how objects are scoped in obj-c.

What is the scope of m_controller (a c++ class) below? The debugger shows m_controller as {...} with no other information. Other than that it seems to run fine.

Can I think of an @interface as something similar to a c++ class?

Also, is there some reading for people familiar with c++ trying to grok obj-c other than the apple dev docs? (something quick and dirty)

// simple.h

#include "controller.hpp"

@interface simple : NSView
{
    @private
        controller m_controller;
}

- (void) initialize_something;
- (void) drawRect: (NSRect) rect;

@end

// simple.mm

- (void) initialize_something
{
    m_controller.initialize_something();
}

- (void) drawRect: (NSRect) rect
{
    NSLog(@"drawRect");
    m_controller.do_something();
}
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to