Re: Newbie Question on "self"

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Scott Ribe <[EMAIL PROTECTED]> wrote: > > Using dot-syntax calls getters and setters. You would > get exactly the same > > behavior by calling self.myString = anotherString. > > That assumes Objective-C 2. The code in question was using properties with synthesized accessors.

Re: Newbie Question on "self"

2008-08-11 Thread Scott Ribe
> Using dot-syntax calls getters and setters. You would get exactly the same > behavior by calling self.myString = anotherString. That assumes Objective-C 2. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-

Re: Newbie Question on "self"

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Todd Heberlein <[EMAIL PROTECTED]> wrote: > Well, you don't need the "self" prefix, but > you may want to look at > using "setters" and "getters". It would > look like this > > @interface MyThingy : NSObject { > ... > NSString* myString; > ... > }; >

Re: Newbie Question on "self"

2008-08-11 Thread Gregory Weston
Matt Keyes wrote: Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (or at least it doesn't compil

Re: Newbie Question on "self"

2008-08-11 Thread Todd Heberlein
- (id)initWithString:(NSString *) string { self.myString = [[NSString alloc] initWithString:string]; } Well, you don't need the "self" prefix, but you may want to look at using "setters" and "getters". It would look like this @interface MyThingy : NSObject { ... NSString*

RE: Newbie Question on "self"

2008-08-11 Thread Matt Keyes
Thanks y'all... in all the Obj-C examples I've read, I've never seen the -> operator used. I should have thought to check! (since in C++ it would be this->whatever). Thanks again, Matt > Date: Mon, 11 Aug 2008 11:05:55 -0700 > Subject: Re: Newbie Question on &quo

Re: Newbie Question on "self"

2008-08-11 Thread Matt Neuburg
On Mon, 11 Aug 2008 17:47:59 +, Matt Keyes <[EMAIL PROTECTED]> said: >Hello again, > >In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" > >i.e. this.m_sMyString = "this is my string"; > >In Objective-C, this does

Re: Newbie Question on "self"

2008-08-11 Thread Jonathan Hess
On Aug 11, 2008, at 10:47 AM, Matt Keyes wrote: Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (

Re: Newbie Question on "self"

2008-08-11 Thread I. Savant
> In Objective-C, this doesn't seem as clear to me (or at least it doesn't > compile). For example: > > - (id)initWithString:(NSString *) string { >self.myString = [[NSString alloc] initWithString:string]; > } > > Produces an error: > > error: request for member 'myString' in something not a

Newbie Question on "self"

2008-08-11 Thread Matt Keyes
Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (or at least it doesn't compile). For example: - (id