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 PROTECTED]> wrote:
> On Mon, Sep 15, 2008 at 12:37 PM, Loren Brichter
> <[EMAIL PROTECTED]> 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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to