0

我試圖構建一個使用QTKit,一些壓縮選項的應用程序。我在蘋果開發者頁面QTCompressionOptionsWindow中看到了這個例子,它使用了一個窗口來達到這個目的。試圖瞭解QTCompressionOptionsWindowTest

在MyController.m線65

有一個評論:

// ******** Compression Options Window ***** 

// create our window with the media type and set ourselves as the delegate 
// you could also instantiate the window directly in the nib and hook up the delegate 
// simply call showWindow or setMediaType if you want to change the list of compression options shown 
mCompressionOptionsWindow = [[QTCompressionOptionsWindow alloc] initWithMediaType:[[[mCaptureMovieFileOutput connections] lastObject] mediaType]]; 
if (nil == mCompressionOptionsWindow) { 
    NSLog(@"Compression Options Window did not load!\n"); 
    return; 
} 
[mCompressionOptionsWindow setDelegate:self]; 

有人可以解釋我什麼是作者試圖解釋

「你可以在筆尖直接實例窗口 「

?他確實有與QTCompressionOptionsWindow

感謝筆尖您的答覆

回答

0

myController的類的該樣品中的目的是簡單地說明如何使用QTCompressionOptionsWindow級 - 特別是,如何建立委託關係。

在樣品myController的,筆者選擇了設置這種關係了的代碼片段您發佈。

的評論只是說,如果你不想做編程,你也可以使用IB用於此目的:只需在NIB那裏創建一個實例(== 實例化)的QTCompressionOptionsWindow級的你把你自己的控制器,並連接它的「委託」插座到你的控制器。

如果這聽起來很亂,請查看「Interface Builder用戶指南」的"Controller Objects""Creating and Managing Outlet and Action Connections"部分。雖然我覺得它們有點稀少(給予目標受衆),但它們相當不錯。