PathControl and OS X 10.11 El Capitan issue

Hi,

So I’m having a Path Control in which I set an URL.
When the user clicks on one of the items it will sent an action and execute this code:


on pathAction_(sender)
      set theCurrentURL to thePUIGroupPathControl's clickedPathItem()'s |URL|()
      set theCurrentURLPathComponents to theCurrentURL's pathComponents()

      -- And then some code to deal with the Components

end pathAction_

Where thePUIGroupPathControl is obviously my NSPathControl object.

Now this works perfectly on Sierra and High Sierra but won’t work on El Capitan.
I’ll get this error:

13-07-18 16:54:14,680 PostLab[1675]: *** -[PUI_Group pathAction:]: missing value doesn’t understand the “pathComponents” message. (error -1708)

So apparently theCurrentURL isn’t filled properly. But according the docs this method should work sinds Mac OS 10.10 Yosemite.
So is it possible to get this working on El Capitan? Or should I take my loss?

Cheers in advance!

Jasper

I’d double-check that thePUIGroupPathControl is valid and that clickedPathItem() is working before giving up.

Okay, finally solved this one. Had to set up a VM with 10.11 and Xcode 8.

But I solved it with this:


set theCurrentURL to thePUIGroupPathControl's clickedPathComponentCell()'s |URL|()
set theCurrentURLPathComponents to theCurrentURL's pathComponents()

Although this method is deprecated according to the documentation it still works on El Capitan and High Sierra.

My bad…

So the code works on all OS’es. When I create a sample project on Mac OS X 10.11 with Xcode 8 with only a path control it will work on all OS’es.
When I create an application from High Siera and Xcode 9 from the same project it will run on 10.11.

But when I use that same code in my application it won’t work on El Capitan.
This is frustrating.

Don’t know where to look any more. More ideas anyone?