Skip to Content
COCOA學習手冊--使用OBJECTIVE-C第三版
book

COCOA學習手冊--使用OBJECTIVE-C第三版

by Paris Buttfield-Addison, Jonathon Manning
June 2013
Intermediate to advanced
360 pages
6h 50m
Chinese
GoTop Information, Inc.
Content preview from COCOA學習手冊--使用OBJECTIVE-C第三版
240
|
第十四章
OS X iOS 上列印文件的 API 及方法完全不相同。在 OS X 上,個別的
NSView
接或透過中間系統被列印。在 iOS 上,則必須透過列印生成器(renderer)及格式化器
formatter)物件的獨立系統來進行。
我們會建造兩支演示 APP,說明如何在 OS X iOS 上列印文件。
OS X 列印
OS X 開發一個有趣的怪地方就是整個繪圖系統的血源可追溯到 PostScript —一種印表機
語言。在 OS X 上,繪製圖形非常容易被轉譯成印表機命令—事實上,轉譯工作係由 OS
為你完成。
給定任何
NSView
,你可以透過把列印訊息傳送給它而列印之,OS X 從這裡開始接手—
列印面板出現,使用者選擇要使用哪個印表機以及如何列印文件。
當視圖被列印時,它的
drawRect:
方法被呼叫—然而,在該方法被呼叫之前所準備的繪
圖環境(graphics context)是設計來產生印表機命令的(特別是 EPS PDF 內容)。這
表示,你所產生的任何自訂
NSView
子類別都已經建立好要進行列印工作。
為了說明列印,我們會建造一支列印
NSTextView
的小範例應用程式。
1.
建立專案
。建立名為
OSXPrinting
的新 Cocoa 應用程式。
2.
建立介面
。打開
MainWindow.xib
a.
NSTextView
拖進 App 的主要視窗,讓它填滿視窗,但在底端留點空間。
b. 拖進
NSButton
,並將它安置在視窗右下方。把它的標籤改變成 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

網頁互動式資料視覺化:使用D3

網頁互動式資料視覺化:使用D3

Scott Murray
深入淺出代數

深入淺出代數

Tracey Pilone, Dan Pilone
自然语言处理实战:从入门到项目实践

自然语言处理实战:从入门到项目实践

Sowmya Vajjala, Bodhisattwa Majumder, Anuj Gupta, Harshit Surana

Publisher Resources

ISBN: 9789862768136