2016-09-21 67 views

回答

0
void getInputSource() { 
    TISInputSourceRef source = TISCopyCurrentKeyboardLayoutInputSource(); 
    NSLog(@"languages: %@", TISGetInputSourceProperty(source, kTISPropertyBundleID)); 
    NSLog(@"localized name: %@", TISGetInputSourceProperty(source, kTISPropertyLocalizedName)); 
    [self awakeFromNib]; 
} 

-(void) awakeFromNib { 
    self.statusBar = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]; 
    NSImage* icon = [NSImage imageNamed:@"icon.png"]; 
    self.statusBar.image = icon; 
} 
0

當你調用myOther,通過自我引用。你應該像這樣定義C方法:

void myOther(id callBack) 

現在你在c函數中有自引用。

void myOther(id callBack){ 
    [callBack myExample]; 
}