Re: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Kyle Sluder
On Tue, Sep 20, 2016, at 02:56 AM, Allan Odgaard wrote: > Minor improvement on the code below, when title is equal to plainTitle > we can set attributedTitle to nil. > > This restores proper rendering of disabled items. > > Finder should be able to do the same, as when its dynamic menu items

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Sean McBride
On Tue, 20 Sep 2016 16:41:07 -0700, Greg Parker said: >Those crashes are expected. > >NSTableView's delegate is zeroing-weak when both of the following are true: >* Your app was built with the 10.11 SDK or newer. >* Your app is running on 10.12 or newer. > >The delegate is unsafe-unretained when

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Greg Parker
> On Sep 20, 2016, at 2:47 PM, Sean McBride wrote: > > On Tue, 20 Sep 2016 14:26:27 -0700, David Duncan said: > >>> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: >>> >>> Hi all, >>> >>> WWDC 2016 Session 203 "What's New in Cocoa" at

Re: Success with NSTableView weak delegates?

2016-09-20 Thread David Duncan
> On Sep 20, 2016, at 2:47 PM, Sean McBride wrote: > > On Tue, 20 Sep 2016 14:26:27 -0700, David Duncan said: > >>> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: >>> >>> Hi all, >>> >>> WWDC 2016 Session 203 "What's New in Cocoa" at

Re: Success with NSTableView weak delegates?

2016-09-20 Thread Sean McBride
On Tue, 20 Sep 2016 14:26:27 -0700, David Duncan said: >> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: >> >> Hi all, >> >> WWDC 2016 Session 203 "What's New in Cocoa" at around 43:37 in the >video, says that if you link against the 10.11 SDK that NSTableView's

Re: Passing param by reference then using within block throws exception

2016-09-20 Thread Doug Hill
I think this is the exact solution. As I'm sure you've tried, you can't use the __block modifier on method parameters, as you will get the following compiler error: __block attribute not allowed, only allowed on local variables So, you're doing the right thing creating the local as a temporary

Re: Success with NSTableView weak delegates?

2016-09-20 Thread David Duncan
> On Sep 20, 2016, at 1:21 PM, Sean McBride wrote: > > Hi all, > > WWDC 2016 Session 203 "What's New in Cocoa" at around 43:37 in the video, > says that if you link against the 10.11 SDK that NSTableView's delegate is > weak. So I went and wrapped my delegate

Passing param by reference then using within block throws exception

2016-09-20 Thread Steve Mills
I'm turning on ARC for a project (yay) and have run into a problem I can't wrap my head around. It always worked fine before ARC. When I turn zombies on, doing "memory history 0x610004279ac0" can't find it in the history. Here's the method and the call to it: -(void)

Success with NSTableView weak delegates?

2016-09-20 Thread Sean McBride
Hi all, WWDC 2016 Session 203 "What's New in Cocoa" at around 43:37 in the video, says that if you link against the 10.11 SDK that NSTableView's delegate is weak. So I went and wrapped my delegate nil-ing in: #if MAC_OS_X_VERSION_MAX_ALLOWED < 101100 [tableView setDelegate:nil];

Re: Conditionally declaring a BOOL in a .m file to be accessed in a .c function

2016-09-20 Thread Ryan Dignard
This doesn't work? in the .m file at file scope BOOL condition = NO; in the .c file at file scope extern BOOL condition; On Tue, Sep 20, 2016 at 8:14 AM, Alex Zavatone wrote: > I've been beating my head against the wall on this one. > > I'm trying to evaluate a condition and

Re: How to Launch an App using the Bundle ID?

2016-09-20 Thread Charles Srstka
> On Sep 20, 2016, at 5:48 AM, Dave wrote: > > Hi All, > > > I’m using launchApplication method from Shared Workspace, however, it accept > an Application Name and all I have is the Bundle ID. How can I launch an App > using the Bundle ID? > > All the Best > Dave

Conditionally declaring a BOOL in a .m file to be accessed in a .c function

2016-09-20 Thread Alex Zavatone
I've been beating my head against the wall on this one. I'm trying to evaluate a condition and declare or conditionally #define a macro within an Objective-C method function that can be checked within a c function. Ideally, I'd just like a #define, but this like it to be a BOOL or, since this

Re: Package installation on MacOS Sierra

2016-09-20 Thread Jonathan Mitchell
Sorry. This was a false alarm. It turns out that I was anticipating a new installation into /Applications. However I had a prior installation in username/Downloads so that got updated instead. J > On 18 Sep 2016, at 22:22, Jonathan Mitchell wrote: > > Hi > > I have a

Re: How to Launch an App using the Bundle ID?

2016-09-20 Thread Allan Odgaard
On 20 Sep 2016, at 12:48, Dave wrote: I’m using launchApplication method from Shared Workspace, however, it accept an Application Name and all I have is the Bundle ID. How can I launch an App using the Bundle ID? There is `LSCopyApplicationURLsForBundleIdentifier` under Launch Services.

How to Launch an App using the Bundle ID?

2016-09-20 Thread Dave
Hi All, I’m using launchApplication method from Shared Workspace, however, it accept an Application Name and all I have is the Bundle ID. How can I launch an App using the Bundle ID? All the Best Dave ___ Cocoa-dev mailing list

Re: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Allan Odgaard
Minor improvement on the code below, when title is equal to plainTitle we can set attributedTitle to nil. This restores proper rendering of disabled items. Finder should be able to do the same, as when its dynamic menu items are disabled, they would normally not contain the dynamic part (info

Re: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Allan Odgaard
On 20 Sep 2016, at 9:11, Dave Lyons wrote: (Ooh! I know that one!) The custom shortcut for Finder's File > Compress menu item continues to work, because Finder goes slightly out if its way to achieve it. The item's -title remains unchanged as ”Compress”, even when you see "Compress “foo”"

Re: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Dave Lyons
(Ooh! I know that one!) The custom shortcut for Finder's File > Compress menu item continues to work, because Finder goes slightly out if its way to achieve it. The item's -title remains unchanged as ”Compress”, even when you see "Compress “foo”" or "Compress 42 Items” -- in that case, you're

NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Allan Odgaard
Some menu items use titles dynamically updated in validateMenuItem: (based on application state, like if there are selected content). This seems to be incompatible with System Preferences → Keyboard → Shortcuts → App Shortcuts, as the menu item check for custom bindings using their current