Search code examples
objective-cmacoscocoanssearchfield

Displaying progress indicator inside an NSSearchField


I am using a NSSearchField to run a query over the internet and display the results in a table view. Whilst the query is running I would like to display a progress indicator inside an NSSearchField? I think I have seen this done in another application before.

Is there an open source component that I could use to accomplish this?

How would I go about doing this? What is the best way? What are the pitfalls?


Solution

  • The easiest way is to put the progress indicator above (atop) the search field and leave them as separate views. It used to be that view z-ordering would give unpredictable results and weren't encouraged. That's not been true for several OS X versions, now, so if it looks good and behaves as expected, I say go for it.

    The harder way would be to subclass NSSearchField and muck around according to the goodies found in the Control and Cell Programming Topics for Cocoa guide.