[閒聊] Interface Builder 3.0

看板MacDev作者 (Andrew)時間16年前 (2007/11/30 15:34), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
話說這幾天在適應XCode 3.0的開發環境,碰上Interface Builder 3.0 過去大家熟悉,在MainMenu.nib window裡的classes browser不見了 要create custom object怎辦呢? 方法一: 在IB的Library window內找到要subclassing的class,拉到MainMenu.nib的window內 就會出現一個instance,這時打開inspector window內的identity inspector 將class identity改成custom class name(自定名稱) 再加入outlets、actions,最後按menu->File->write class files 方法二: 先在Xcode內,在classes group(or where ever)按右鍵add->new file 選擇適合的objective-c class or subclass,打入名稱 新增完在.h內自己寫outlet跟action的code 再到IB,從Library拉parent class(ex. NSObject)到nib window 最後依方法一中修改class identity為custom class name IB就會從Xcode同步outlet,action的內容 目前網路上找到的方法多為這兩種,而ADC上的IB guide建議採用方法二 不知道是否是有更直覺的作法? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.130.175.100

12/03 22:17, , 1F
看樣子是沒有其他的方法,我個人蠻喜歡方法一,比較正統
12/03 22:17, 1F

12/11 03:18, , 2F
果然沒有其他方法,IB 改成這樣的原因是個謎...挨
12/11 03:18, 2F
文章代碼(AID): #17JxpsjR (MacDev)