Scope in an interface?
Scope in an interface?
- Subject: Scope in an interface?
- From: Graham Reitz <email@hidden>
- Date: Sun, 25 May 2008 00:29:30 -0500
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 (email@hidden)
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:
This email sent to email@hidden