Re: Object property initialization problem
Re: Object property initialization problem
- Subject: Re: Object property initialization problem
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 20 Apr 2004 17:05:05 -0500
At 5:41 PM -0400 4/20/04, Randall Perry wrote:
So, tried to access it and got 'Cannot resolve symbol' error.
That's a compile time error you're talking about, right? Does the
compiler error say _which_ symbol it can't resolve? This often shows
up in the middle text pain of the build panel.
Thought ok, so
I need to create a dummy instance of the class object because the compiler
doesn't know it's going to be set by the Direct Action, so I created it.
Nope, that's not so. That's not what that error is indicating.
public CustView custInfo = new CustView();
String custDir = "/Users" + custInfo.userName;
Then I got the same error trying to access the object property 'userName'.
So tried initializing userName to an empty string but couldn't find a way to
do it without error:
Nope, it's not an issue of initializing something here. Sounds to me
like the compiler can't find the "CustView" class at all. Sure you
haven't misspelled it? Are you using frameworks, or is everything in
one project? Try cleaning and recompiling, and/or "re-indexing" the
project (get info on project root in XCode, click "re-index" or
something like that).
public CustView custInfo = new CustView();
custInfo.setUserName("");
2nd line above generates error "<identifier> expected"
That's because you can't declare a local variable with access
modifiers like "public". Local variables don't have access modifiers,
only instance variables.
--Jonathan
Any help is appreciated.
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales
http://www.systame.com/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.