Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4, Cocoa Title bar removing from interface builders disables textView from editing

I am designing an application without a title bar, however when I remove the title bar using interface builder in Xcode 4 , it causes the editable fields (the ones I tried are textView, and textField) not being editable, despite editable checked in there properties? why this happens and is there anyway to prevent it?

like image 804
Nabi Avatar asked Dec 21 '22 06:12

Nabi


1 Answers

You have to subclass your window and overwrite the following methods:

- (BOOL)canBecomeKeyWindow {
    // because the window is borderless, we have to make it active
    return YES;
}

- (BOOL)canBecomeMainWindow {
    // because the window is borderless, we have to make it active
    return YES;
}
like image 125
Nickkk Avatar answered Apr 29 '23 09:04

Nickkk