>> Either you have files where ARC is still turned of (via the -fno-arc
option

Nope, no compiler flags at all.

>> Make sure you're properly using NSBridgingRetain() etc. (or
the equivalent typecasts) and not mixing them up.

In the hybrid C++/Obj-C++ files, we use __bridge on all the casts of void
pointers to Cocoa objects.
No use of NSBridgingRetain or Release at all.  Is that necessary under ARC?

The void pointers are mostly to text fields and controls, plus the app
delegate
and one view.  None of those have had lifetime problems.  We mostly just
access them and have them do one thing.

No void pointers to the window controller that is dying, nor its window.



On Sun, Aug 25, 2019 at 3:00 PM <cocoa-dev-requ...@lists.apple.com> wrote:

> Send Cocoa-dev mailing list submissions to
>         cocoa-dev@lists.apple.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.apple.com/mailman/listinfo/cocoa-dev
> or, via email, send a message with subject or body 'help' to
>         cocoa-dev-requ...@lists.apple.com
>
> You can reach the person managing the list at
>         cocoa-dev-ow...@lists.apple.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Cocoa-dev digest..."
>
>
> Today's Topics:
>
>    1. Re: ARC (Jens Alfke)
>    2. Re: ARC (Uli Kusterer)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 25 Aug 2019 09:42:28 -0700
> From: Jens Alfke <j...@mooseyard.com>
> To: Turtle Creek Software <supp...@turtlesoft.com>
> Cc: cocoa-dev@lists.apple.com
> Subject: Re: ARC
> Message-ID: <84dce981-cc3d-488f-bf68-5462d8d98...@mooseyard.com>
> Content-Type: text/plain; charset=utf-8
>
>
> > On Aug 24, 2019, at 4:46 AM, Turtle Creek Software <
> supp...@turtlesoft.com> wrote:
> >
> > Our app delegate class is not deallocated.  The window controller is
> deallocated
> > despite the member reference there.
>
> That should not be possible. Could you paste the exact line of code that
> declares the window-controller reference in the app delegate?
>
> Have you verified that, at the point when the controller is dealloced, the
> reference in the app delegate is still non-nil? (I sometimes find it useful
> to set a breakpoint in the dealloc method, in weird cases like this.)
>
> Do you have any remaining code that messes with ref-counting, I.e. by
> using CFRetain/Release on Obj-C objects?
>
> ?Jens
>
> (And let me chime in that ARC is an excellent feature. Cocoa used to have
> ?true? garbage collection as an option, but it was rarely used on Mac due
> to memory and performance impact, and never implemented on iOS for that
> reason. ARC works much better. Swift memory management is based on ARC, so
> it?s definitely the way of the future.)
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 25 Aug 2019 20:43:54 +0200
> From: Uli Kusterer <witness.of.teacht...@gmx.net>
> To: cocoa-dev@lists.apple.com
> Subject: Re: ARC
> Message-ID: <3c9673ab-990e-f019-1ff2-0722d2d9e...@gmx.net>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> On 8/24/2019 1:44 PM, Turtle Creek Software via Cocoa-dev wrote:
> > Our app delegate class is not deallocated.  The window controller is
> > deallocated
> > despite the member reference there.  If we keep the second strong
> reference
> > to the controller,
> > then the outline view is deallocated instead.  Nothing references the
> view
> > except being in the .xib file for the window controller.
>
>   That doesn't seem possible. You must be doing something else that
> breaks things. A strong reference is a strong reference, an object
> doesn't get deallocated if it's still held. Either you have files where
> ARC is still turned of (via the -fno-arc option or whatever it is
> called) and are assuming it isn't, or it is an unowned
> (unsafe-unretained? Whatever it was called in ObjC) or weak reference.
>
>   You also mention you're using C++. If you are passing pointers through
> C or C++ code (as void* for instance), then you might be doing something
> wrong there. Make sure you're properly using NSBridgingRetain() etc. (or
> the equivalent typecasts) and not mixing them up. That could cause ARC
> to think it owns another reference to an object and release it again.
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
>
> Cocoa-dev mailing list      (Cocoa-dev@lists.apple.com)
>
> Do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins (at) lists.apple.com
>
> https://lists.apple.com/mailman/listinfo/cocoa-dev
>
>
> ------------------------------
>
> End of Cocoa-dev Digest, Vol 16, Issue 72
> *****************************************
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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

This email sent to arch...@mail-archive.com

Reply via email to