→ LFimi: 你確定是同一個instance? 03/28 15:29
→ uranusjr: 資訊不足, 可能性太多, 請附上更詳細的程式碼 03/28 15:56
謝謝兩位幫忙,大概就是把A.h下宣告的NSPopUpButton在B.m中
取得NSPopUpButton裡面字串資訊這樣
比方說在A.h中宣告
IBOutlet NSPopUpButton *popupBut;
然後我在B.m中@import "A.h"後宣告
A *smA = [A alloc];
NSString *getstring =
[NSString stringWithFormat:@"%@",[smA.popupBut titleOfSelectedItem];
來讓getstring抓到A.h NSPopUpButton的值這樣
抱歉一開始沒有說得很清楚,謝謝!
※ 編輯: aureolus (60.248.134.2), 03/28/2016 17:41:03
→ yuanruo: 你應該是要把a的instance傳給b而不是再b alloc新的 03/28 18:41
推 Blueshiva: 你要在Storyboard把popupBut Link到某個NSPopUpButton 03/29 01:30
→ howdiun: [NSStoryboard storyboardWithName:@"XXX" bundle:nil]; 03/29 09:20
→ howdiun: [storyboard instantiateControllerWithIdentifier:XXX]; 03/29 09:21
→ howdiun: button是storyboard幫你產生的,否則他從頭到尾都是null 03/29 09:25
謝謝各位的幫忙,以用上述的方向成功解決了問題,謝謝大家!
※ 編輯: aureolus (60.248.134.2), 03/29/2016 13:34:13