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.
I’m working on a menubar note-taking app with Simplenote syncing support, and it’s been
Share
Simplest way is to break apart the string using
-componentsSeparatedByString:and pass in\nwhich will return an array with the components broken apart. Then grab the zeroth element from the array.