diff --git a/src/osx/cocoa/combobox.mm b/src/osx/cocoa/combobox.mm index 0438d14866..56ce4b05ca 100644 --- a/src/osx/cocoa/combobox.mm +++ b/src/osx/cocoa/combobox.mm @@ -124,7 +124,10 @@ wxString wxNSComboBoxControl::GetStringAtIndex(int pos) const int wxNSComboBoxControl::FindString(const wxString& text) const { - return [m_comboBox indexOfItemWithObjectValue:wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()]; + int result = [m_comboBox indexOfItemWithObjectValue:wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()]; + if (result == NSNotFound) + result = wxNOT_FOUND; + return result; } wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxWindowMac* wxpeer,