Re: Strange property behavior
Re: Strange property behavior
- Subject: Re: Strange property behavior
- From: atebits <email@hidden>
- Date: Mon, 15 Sep 2008 10:22:28 -0700
Yes,
at this line:
NSString *n = [o someMethod].someProperty;
the -someMethod method body is literally executed twice (control isn't
handed back to the calling function until after the second "return
self;".
- (MyTestClass *)someMethod
{
NSLog(@"someMethod called");
return self;
}
Loren
On Mon, Sep 15, 2008 at 10:13 AM, Kyle Sluder
<email@hidden> wrote:
> On Mon, Sep 15, 2008 at 12:37 PM, Loren Brichter
> <email@hidden> wrote:
>> Call me crazy, but I'm only calling [o someMethod] once in the above
>> code... so why is it getting called twice? Imagine my frustration
>> tracking down the bug when -someMethod has side effects :).
>
> Did you step through it in gdb to see what was going on?
>
> --Kyle Sluder
>
_______________________________________________
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