Re: C++ pointer to Cocoa object
> Le 7 sept. 2018 à 19:46, Casey McDermott a écrit : > > We need to link some of our C++ classes to a matching Cocoa class. > It's easy for Cocoa to reference C++ objects. Going the other way is harder. > > We have been using a linker class that has a void pointer to the Obj-C object > in the C++ header. We then cast it to a Cocoa object in the Obj-C++ source. > For example, in the C++ header we have: > How are you setting the pointer ? If you are using ARC and want to get a strong reference on the object, you have to use __bridge_retained, which tell ARC to keep the reference valid. Once you are done with the objc object, you have to release it. > void *mCocoaPopupPtr = nil; > > Then in the source: > > void GSCocoaPopupLinker::setCocoaFieldVisible(const BOOL inValue) > { > if (mCocoaPopupPtr != nil) > { > GSPopupButton *cocoaPopup = (__bridge GSPopupButton > *)mCocoaPopupPtr; > [cocoaPopup setHidden : !inValue]; > } > } > > Problem is, with ARC turned on, the pointer is never nil, so it crashes. > The void pointer somehow becomes an NSAtom instead of 0. > > There's very little documentation on NSAtom, but it appears to be Apple's way > to > use the excess bits in a 64-bit address to store class info. > > Is there some other way to test for an invalid void pointer? > > Thanks, > > Casey McDermott > TurtleSoft.com > ___ > > 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/mailing%40xenonium.com > > This email sent to mail...@xenonium.com ___ 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
Re: C++ pointer to Cocoa object
>> If you are using ARC and want to get a strong reference on the object, you have to use __bridge_retained That is handy to know! I see there is also __bridge_transfer to go the other way. In this case we put the Cocoa controls into a NSView, which releases them. The NSView deletes our LView, which deletes the C++ controls. Thanks, Casey McDermott www.TurtleSoft.com ___ 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
Re: How to clear macOS app bundle cache
On 07.09.2018 at 23:45 Sean McBride wrote: > On Mon, 3 Sep 2018 15:31:37 +0200, Andreas Falkenhahn said: >>Optimally, I'm looking for a solution to flush the app bundle cache on >>the iMac from the makefile that I run on the Mac Mini I use for building. > Not sure what "the app bundle cache" is That's just a name I came up with to describe the phenomenon I'm seeing here. > , but maybe nuking the LaunchServices db would help? Unfortunately not. I can see my app in the lsdump and the path points to the network share but purging the LS database doesn't have any effect. macOS still loads the old version of my app, not the latest one on the share. Only by rebooting or by re-copying the bundle's executable can I force macOS to use the latest copy. -- Best regards, Andreas Falkenhahnmailto:andr...@falkenhahn.com ___ 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
Re: How to clear macOS app bundle cache
> On 8 Sep 2018, at 21:20, Andreas Falkenhahn wrote: > > Unfortunately not. I can see my app in the lsdump and the path points to the > network share but purging the LS database doesn't have any effect. macOS > still loads the old version of my app, not the latest one on the share. Only > by rebooting or by re-copying the bundle's executable can I force macOS to > use the latest copy. I don’t think there’s any “application cache” here, it’s just the filesystem cache getting in the way (on some level). I haven’t been successful in disabling the SMB client side cache to achieve what you want, but this works for me: sshfs -o cache=no,nolocalcaches,volname=buildmachine buildmachine.local:/ /mnt/buildmachine/ Cheers, Tor Arne ___ 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
NSAlert
I have a simple NSAlert presented as an attached sheet with a single default OK button. When the spacebar is pressed the alert is dismissed. It this a new thing? Is this documented anywhere? --Richard Charles ___ 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
Re: NSAlert
I don't know where or whether it's documented, but it's not new. Using Space for "clicking" whichever control has focus has been around for a while. I don't remember offhand -- it may depend on the setting in System Preferences that governs whether all controls can get keyboard focus. --Andy On Sat, Sep 8, 2018, at 6:53 PM, Richard Charles wrote: > I have a simple NSAlert presented as an attached sheet with a single > default OK button. > > When the spacebar is pressed the alert is dismissed. > > It this a new thing? > > Is this documented anywhere? > > --Richard Charles > > ___ > > 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/aglee%40mac.com > > This email sent to ag...@mac.com ___ 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
Re: NSAlert
Which version of macOS are you running? Sent from my iPhone > On Sep 8, 2018, at 5:53 PM, Richard Charles wrote: > > I have a simple NSAlert presented as an attached sheet with a single default > OK button. > > When the spacebar is pressed the alert is dismissed. > > It this a new thing? > > Is this documented anywhere? > > --Richard Charles > > ___ > > 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/zav%40mac.com > > This email sent to z...@mac.com ___ 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