Scope in a class
Scope in a class
- Subject: Scope in a class
- From: Sanri Parov <email@hidden>
- Date: Mon, 6 Jun 2005 22:07:24 +0200
Hi everybody.
I know Cocoa is very strict 'bout scoping, but I can't solve this.
The problem is I can't access a variable if I have allocated it into
another method.
In this example, from the "dummy" method, the variable d_dbase is out
of scope.
Why, if it's declared as public in the header file?
Thanks to all for the kind answers.
------------------H E A D E R F I L E ------------------
@interface myGTEd : NSObject
{
@public
QuickLiteDatabase* d_dbase;
}
@end
---------------------------------------------------------
------------------C L A S S F I L E ------------------
@implementation myGTEd
- (IBAction)newDB:(id)sender
{
d_dbase= [QuickLiteDatabase databaseWithFile:d_dbaseNome];
}
- (IBAction)dummy:(id)sender
{
[d_dbase performQuery:@"SELECT creatore FROM datiGenerali;"];
}
---------------------------------------------------------
--
Sanri Parov
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden