• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange property behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Strange property behavior
      • From: dreamcat7 <email@hidden>
References: 
 >Strange property behavior (From: "Loren Brichter" <email@hidden>)

  • Prev by Date: Strange property behavior
  • Next by Date: Re: async NSOperation and NSOperationQueue
  • Previous by thread: Strange property behavior
  • Next by thread: Re: Strange property behavior
  • Index(es):
    • Date
    • Thread