--- 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.
> 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-
--- 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;
> ...
> };
>
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
- (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*
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
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
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 (
> 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