코코아 문자 시스템
Cocoa text system코코아 텍스트 시스템(이전에는 기본 클래스 이름 NSText로 간단히 알려져 있음)은 타이포그래피와 텍스트 필드 편집 기능을 제공하는 클래스, 프로토콜, 인터페이스 및 객체의 링크된 네트워크로, 애플사의 MacOS의 코코아 어플리케이션에 기본 텍스트 처리 시스템이다.[1]비록 "매우 복잡하다"지만, 코코아 텍스트 시스템의 표준 텍스트 처리 능력은 비(非)[2][3] 동급자가 없는 것으로 널리 칭송되어 왔다.코드의 몇 줄에만 완전한 기능을 갖춘 리치 텍스트 편집기를 구현할 수 있다.[4][5]
이전에는 개발자 NeXT의 오픈 스텝 API사양을 참조하고 넥스트의 오픈 스텝 운영 체제에서 구현되서 좀 더 일찍 NeXTSTEP[표창 필요한]플랫폼 아마도 또한, 코코아의 NSText 추가로 그 OpenStep은 API규격을 통해 성공적으로 free-and-open- 같은 제3자 구현에서 시행하고 있embodied[6].소스 그누 스텝.[6]
코코아 텍스트 시스템은 모델-뷰-컨트롤러 설계 패턴을 사용한다.[7]뷰 레이어는 NSTextView와 NSTextField에서 처리하며, NSLayoutManager와 NSTextContainer는 컨트롤러 레이어, NSTextStorage(변수 귀속 문자열 하위 클래스)가 모델이다.[8]
코코아 텍스트 시스템은 또한 GUI 환경에서 표준 스트림 기능을 제공하기 위해 서비스와 상호 작용한다.사용자는 NSTextField(단일 줄 편집 필드 제공) 또는 NSTextView(다중 줄 편집 제공)의 두 클래스와 상호 작용한다.각 NSTextField는 "필드 편집기"라고 불리는 NSTextView의 공유 인스턴스를 사용한다.이는 각 필드가 실제로 언제든지 한 필드만 포커스를 가질 수 있을 때 모든 필드가 자체 NSTextView 객체 그래프를 구현할 경우 발생할 수 있는 높은 메모리 요구사항을 줄이기 위해 수행되었다.[9]
코코아는 프로그래머들에게 친숙한 많은 Emacs 키 바인딩을 채택한다.[10]
참조
- ^ "About the Cocoa Text System".
- ^ Anguish, Scott; Buck, Erik M.; Yacktman, Donald A. (2003). Cocoa Programming. ISBN 9780672322303.
- ^ "Arise Aqua!".
You’ll build a word processor capable of handling kerning, justification, sub and superscripting, full Unicode support, spell checking, multiple font and paragraph styles, drag and drop of embedded graphics and colors, rulers with adjustable tab stops, reading and writing of conforming RTFD files, all in less than 13 lines of code! You cannot do this in any other development environment on the planet.
- ^ "Rich Text Handling".
- ^ "Getting Started Developing For Mac OS X".
There is very little custom code in TE and what is there is basically only the code necessary to make the AppKit behave like a text editor.
- ^ a b "GNUstep". gnustep.org. Retrieved 2020-08-16.
- ^ "The Cocoa text system's architecture is both modular and layered to enhance its ease of use and flexibility. Its modular design reflects the Model–View–Controller paradigm (originating with Smalltalk-80) where the data, its visual representation, and the logic that links the two are represented by separate objects. In the case of the text system, NSTextStorage holds the model's text data, NSTextContainer models the geometry of the layout area, NSTextView presents the view, and NSLayoutManager intercedes as the controller to make sure that the data and its representation onscreen stay in agreement".
- ^ "From Win32 to Cocoa: a Windows user's conversion to Mac OS X?Part III".
- ^ Dovey, James; Furrow, Ashley Alonzo Hale (4 January 2013). Beginning Objective C. ISBN 9781430243694.
- ^ "Cocoa Text System".