Core Data and NSTableView show content as title
I'm working on a menubar note-taking app with Simplenote syncing support, and it's been using a separate title and content for each note. It shows the title in an NSTableView and the content in an NSTextView, but now I would like for it to show the content as the title in the table view like in Simplenote. My problem is that I would like for it to show the title only up until it reaches开发者_运维问答 a newline, but I don't know how to do it.
Simplest way is to break apart the string using -componentsSeparatedByString:
and pass in \n
which will return an array with the components broken apart. Then grab the zeroth element from the array.
精彩评论