Re: Protecting against "app nap"
Re: Protecting against "app nap"
- Subject: Re: Protecting against "app nap"
- From: Jens Alfke <email@hidden>
- Date: Wed, 11 May 2016 08:10:53 -0700
> On May 11, 2016, at 2:31 AM, Jonathan Taylor <email@hidden> wrote:
>
> I guess I just found method naming a bit odd (not really referring to an object at all), and might have expected it to have an ‘alloc/new’ naming since I’d have thought the API would be almost exclusively used for activities that continue beyond the calling scope.
The only methods named +alloc or +new are the core methods on NSObject that instantiate objects. (There’s also -copy and -mutableCopy.) Regular methods don’t use that naming scheme nor return owned references, they just consistently return unowned references. That keeps the rules simpler.
(And I really recommend using ARC! It saves trouble and eliminates a lot of bugs, like this one.)
—Jens
_______________________________________________
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