Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:41:57+00:00 2026-05-14T04:41:57+00:00

I am working on a cocoa-based text editor. Should I base it on NSTextView

  • 0

I am working on a cocoa-based text editor. Should I base it on NSTextView or is there a more efficient option? Keep in mind that I plan to support tabs so there can be many editors open at the same time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:41:58+00:00Added an answer on May 14, 2026 at 4:41 am

    I am working on a cocoa-based text editor. Should I base it on NSTextView

    Yes.

    or is there a more efficient option?

    No, assuming “efficiency” includes your own time and effort weighed against the feature set you want to support—Cocoa’s text system does a lot for you, which you’d be throwing away if you rolled your own.

    Some examples:

    • Undo support
    • Advanced editing (emacs keys)
    • Support for input managers/input methods
    • Support for all of Unicode
    • Mouse selection
    • Keyboard selection
    • Multiple selection
    • Fonts
    • Colors
    • Images
    • Sounds
    • Find
    • Find and Replace
    • Spelling-checking
    • Grammar-checking
    • Text replacement
    • Accessibility

    If you roll your own, you get to spend months reinventing and debugging some if not most if not all of those wheels. I call that inefficient.

    The text system you already have, meanwhile, is fast nearly all of the time. You need huge texts with long lines (or maybe lots of embedded images/sounds) to bog it down.

    Keep in mind that I plan to support tabs so there can be many editors open at the same time.

    Unless the user is going to be typing into all of them at once, I don’t see how that will cause a performance problem. 0% CPU × N or N-1 views = 0% CPU.

    The one place where you might have a problem is memory usage, if the documents are both many and large. They’d have to be both in the extreme, as even a modest Mac nowadays has 1 GiB of RAM, and text doesn’t weigh much.

    If that’s the case, then you could only keep the N most recently used unmodified texts in memory, and otherwise remember only the arrays of selection ranges. But 99% of the time, swapping texts in and out will be far more expensive than just leaving them all in memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.