An NSSearchField object implements a text field control that is optimized for performing text-based searches. The control provides a customized text field for entering search data, a search button, a cancel button, and a pop-up icon menu for listing recent search strings and custom search categories. An NSSearchField object wraps an NSSearchFieldCell object.
Questions tagged [nssearchfield]
115 questions
4
votes
1 answer
How to change background color of NSSearchField (like in Messages app in OS X)
I need to get this appearance of NSSearchField
But it seems to be impossible to set backgroundColor with standard methods of Interface Builder. How i can achieve this?
Subclassing NSSearchField and NSSearchFieldCell didn't help, because i loose…

surfrider
- 1,376
- 14
- 29
4
votes
2 answers
NSTextView + NSTextFinder + my separate NSSearchField
I am trying to implement searching in NSTextView with search query coming from my custom NSSearchField.
Sounds pretty simple, but I cannot get it working.
So far I've looked through all the Apple Documentation about NSTextFinder, its client and…

UJey
- 1,442
- 11
- 15
4
votes
2 answers
NSSearchField continuously calls method
I have created an NSSearchField that stores a list of recent searches. The search field is connected to a method that updates a label in the window with the text typed into the search field. The problem is that the label updates as soon as the…

wigging
- 8,492
- 12
- 75
- 117
3
votes
3 answers
Getting function key press on NSSearchField without subclassing
I have a simple application which has an NSSearchField and I want to know if the user presses, for example, an arrow key. I don't want to subclass, because I want to modify the values of the IBOutlets in my aplication, and I can't do that in a…

Javier Beltrán
- 756
- 5
- 26
3
votes
0 answers
NSSearchField with tokenized search values
I am looking for a way to implement the search input with tokens like in mail apps to achieve a similar result:
I wonder if there is a straightforward way to implement it. I spent some time investigating if there is anything similar open sourced…

Defari
- 71
- 6
3
votes
0 answers
NSSearchField with Suggestions view underneath like Spotlight MacOS cocoa Swift 4.2
I want to write a MacOS Cocoa Desktop App with XCode 10 and Swift 4.2.
It should have a searchfield with a suggestions view opening as you keep typing like Google Search or Spotlight with autocompletion.
However I'm completely new to Cocoa…

es1
- 1,231
- 3
- 14
- 27
3
votes
1 answer
How can I pass a parameter to a selector?
I have an NSSearchField:
[searchField setAction:@selector(doSearchWithQuery:)];
Here is my doSearchQuery:
-(void)doSearchWithQuery:(NSString*)query{
How can I pass the contents of my searchfield into doSearchWithQuery?

Sheehan Alam
- 60,111
- 124
- 355
- 556
3
votes
2 answers
Detect current input language
I am building an app which allows users to check the local time in any place around the world. The information is being fetched using Google APIs and all works well, but for the best results I need to specify the language which I would like to…

Andriy Gordiychuk
- 6,163
- 1
- 24
- 59
3
votes
3 answers
OSX Cocoa NSSearchField clear button not responding to click
I place an NSSearchField and set its border to none and I found that the clear button is not clickable a.k.a. not responding when clicked. If I set the border again it's working fine.
I've been debugging this for a few hours, and found out that…

sendy halim
- 405
- 4
- 11
3
votes
1 answer
Cocoa - NSSearchFieldDelegate methods is not called
I have simple NSSearchField on view of NSVIewConroller. and connected the NSSearchFIeld's delegate to the view controller. And I have implemented the NSSearcHFieldDelegate Methods as follows:
- (void)searchFieldDidStartSearching:(NSSearchField…

Shanmugaraja G
- 2,778
- 4
- 31
- 47
3
votes
0 answers
Display occurrences count in NSSearchField
I have an NSSearchField in IB connected to my controller that search on a NSTextView using NSTextfield delagate methods, and I can find and store in an array all ranges of particular text placed in the search field.
The question is:
how can I show a…

Mike97
- 596
- 5
- 20
3
votes
3 answers
Center placeholder string in NSSearchField after it was changed
I have a NSSearchField in UI with a placeholderString. By default its value is Search and it is centered automaticaly. But when user change selection in the sidebar I replace placeholder string with "Search in {NAME OF SIDEBARITEM}". For…

Vladimir Prudnikov
- 6,974
- 4
- 48
- 57
3
votes
1 answer
NSSearchField not working as expected
I'm trying to follow Marcus Zarra in his book 'Core Data'. In the book, he makes a small sample application, but it doesn't give much help when things don't work out...
He starts out by visually designing three entities, and then adding array…

Vegar
- 12,828
- 16
- 85
- 151
3
votes
2 answers
[NSSearchField object]: unrecognized selector sent to instance
I'm testing Swift in a simple Mac app. I got a NSToolbar in Storyboard and draw a NSSearchfield inside. The NSSearchfiled is connected to the First Responder's method controlTextDidChange (the first responder is the ViewController where I added…
user3903523
3
votes
1 answer
Override NSSearchField "Clear field" behavior
I need to override NSSearchField action which happens when you clear the contents of the field with the "Clear" button.
The default fired selector is private: _searchFieldCancel.
[UPDATE]
OK, I've found a solution.
But how can I prevent searchField…

NikGreen
- 700
- 9
- 28