Shiva Kumar Shiva Kumar - 3 months ago 27
Swift Question

NSTableview reloadDataForRowIndexes sounds in mac

I am developing an app for Mac, I am getting a weird issue. When ever i reload a row and for a particular column when the reload code executes i am getting a sound output from my mac.

Below is the code

myTableView.reloadDataForRowIndexes(myTableView.selectedRowIndexes, columnIndexes: NSIndexSet.init(index: myTableView.columnWithIdentifier("source")))


I have a column with identifier "source", When ever i try to reload and after the execution of the above line i am getting sound in my mac.

I am using Xcode 7.3, OSX 10.11.6

Answer

Finally i found the issue. I debugged the code in depth and found the root cause.

Sound is coming when ever i am calling below code, here sourceTextField is a NSTextField. I commented this code and every thing is working fine.(i can directly give the value to text field like sourceTextField.stringValue.)

sourceTextField.insertText(itemText)

Thanks to all of you who made some time to write a comment/ post a message, Sorry for bothering you all guys.

Comments