NSSearchField and SearchField oddness

The Xojo docs says the SearchField control is for macOS10.12 and higher.
If this is using the NSSearchField, it should be compatible with 10.3 and higher.

  • Why is the SearchField only for macOS 10.12 and higher?
  • And what happens when it is run on an older macOS version? Will the app crash?

We don’t support older versions of macOS and there have been other framework changes that will require newer versions, so yes, your app will probably crash.

Basically the problem is that supporting older versions prevents us from supporting newer ones, so we have to choose. Never mind the fact that 10.3.x system requirements included:

  • Models with a PowerPC G3, G4, or G5 processor (233 MHz minimum)

I inderstand. But I need to keep support for at least macOS 10.10 which outrules using the Searchfield.
I am using the NSSearchFieldMBS and that works fine with 10.10

I was planning to switch to the Xojo Searchfield but that will not work, so it seems.

I did figure out which API call it was that was causing the Xojo Search field to not work with older versions of the Mac OS, but then I swapped to using my own NSSearchField and forgot all about it.

That’s what I now do. :slight_smile:

Anyhow, the latest Xojo can build for macOS 10.10 but it cannot use its own SearchField for those macOS versions. That’s not good imo
I suggest Xojo would use NSSearchField instead. That fixes two things: It will run on macOS 10.10 and it would be native too.

2 Likes

IIRC all it needs is the API that requires 10.13 be wrapped in [NSObject respondsToSelector:].

I don’t have a machine left that can run an older version of the macOS anymore, so I can’t test it at the moment. We could log a Feedback case, but I don’t suppose many people care enough and those like you and I, will use an alternative.

1 Like

FYI: <https://xojo.com/issue/67275>

1 Like

We already are using an NSSearchField on macOS. Problem is that we’re using an API that requires maOS 10.12.2.

MBS and Ohanaware Appkit both has NSSearchField and can be run on macOS 10.10
What exactly are you using that requires 10.12.2 for NSSearchField?

EDIT:
I just read the complete Apple docs for NSSearchField and nothing related requires 10.12.2 or higher.

Maybe they aren’t using the native one but emulating it.

NSSearchField is a subclass of NSTextField and we set its AutomaticTextCompletion property to true.

Oh but when we report it, it’s brushed off as not a bug. <https://xojo.com/issue/63521>

Then the fix is really simple, when you go to set that property, simply check to see if the object responds to the selector, if not then move along.

1 Like

Right. Fixed for a future release.

2 Likes

Or just not use AutomaticTextCompletion
That is useless in a searchfield imo.