interface-builder

Check if NSTextView has been edited

邮差的信 提交于 2020-01-06 05:48:04
问题 Is there a way to get notified when a NSTextView gets modified?. In a NSTextField I just set the target for the default sent action and works perfectly, but I don't see any sent actions on a NSTextView. 回答1: Come on guys. Polling? Really? NSTextView inherits from NSText, which conforms to the NSTextDelegate protocol. Look it up in the docs. The method you are looking for is: - (void)textDidChange:(NSNotification *)aNotification which you can either implement in your TextView's delegate or get

Subclassing a NSTextField

╄→гoц情女王★ 提交于 2020-01-06 05:34:08
问题 I want to expand on the functionality of NSTextField. AMong the things I want to achieve is: Changing the look and feel of the caret. Detecting when the text reaches a certain number of characters and then coloring the text after that limit differently. * To my great frustration after spending quite some time googling I find hundreds of hits that simply state "Sublass NSTextField and use this code.", and to my humiliation I have found myself unable to grok exactly how to do this. I would be

Is it proper to archive/unarchive NSWindowController?

☆樱花仙子☆ 提交于 2020-01-06 05:01:40
问题 I'm having a difficult time understanding what's going wrong. I have an NSWindowController with a NSWindow and a NSTextView. I want to archive that NSWindowController and NSWindow (along with all of its controls) to a file. Then, I want to unarchive that same NSWindowController and the NSWindow and all views from the file. But Apple docs say: Note: Although the NSWindow class inherits the NSCoding protocol from NSResponder, the class does not support coding. Legacy support for archivers

Xcode - Bind textfield to element of a Swift dictionary

懵懂的女人 提交于 2020-01-06 04:14:07
问题 I did bind a textfield to a Swift dictionary value via interface builder. In the textfield the correct value is pulled from the dictionary and displayed in the textfield. When I change the value of the element in the dict via myDict["Textfield1"] = "New value" the change is not visible in the textfield. When I do bind the value of the textfield to a property of a class, any change to this property is instantly visible in the textfield. Am I missing something? Thanks! 回答1: So basically, it won

DAE file specified in attribute inspector is not loaded by UIViewController

。_饼干妹妹 提交于 2020-01-05 10:17:08
问题 I created a new project using the iOS game template on Xcode 6.1.1, the options were: Language: Swift Game Technology: SceneKit Device: Universal The app runs ok "as is", but now I want to specify the .dae file directly from the Interface Builder on Xcode, so I changed the method in the view controller like this: override func viewDidLoad() { super.viewDidLoad() let scnView = self.view as SCNView // customize the loaded scene if let scene = scnView.scene { //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Why does Interface Builder show hidden views through the views above them?

空扰寡人 提交于 2020-01-05 06:55:07
问题 When nesting views in Interface Builder, if I have an opaque view with hidden views beneath it in the view Hierarchy, the hidden views are visible through the higher view and are just partially translucent like the below picture. Why does this happen and can I make it stop? It's very annoying. To be clear this is strictly in IB. At run time the views are displayed correctly. 回答1: Sad to see this is the best answer that I have found so far: If you set the view you want to work as NOT hidden,

Why does Interface Builder show hidden views through the views above them?

北城余情 提交于 2020-01-05 06:54:07
问题 When nesting views in Interface Builder, if I have an opaque view with hidden views beneath it in the view Hierarchy, the hidden views are visible through the higher view and are just partially translucent like the below picture. Why does this happen and can I make it stop? It's very annoying. To be clear this is strictly in IB. At run time the views are displayed correctly. 回答1: Sad to see this is the best answer that I have found so far: If you set the view you want to work as NOT hidden,

Question about extensiblity of Cocoa Touch Controls

我的未来我决定 提交于 2020-01-05 06:41:26
问题 I'm new to programming for the iPhone and i'm wondering: how extensible are the various controls? Let's take the button as an example: can i change the background graphic? can i make it grow larger when i press on it? can i change the font? can i use a custom font? can i use a button graphic in place of text? 回答1: In general, yes to all your questions. You can subclass the various UI* classes that make up the Cocoa touch controls just like any other classes, and add your own custom

Question about extensiblity of Cocoa Touch Controls

六眼飞鱼酱① 提交于 2020-01-05 06:41:09
问题 I'm new to programming for the iPhone and i'm wondering: how extensible are the various controls? Let's take the button as an example: can i change the background graphic? can i make it grow larger when i press on it? can i change the font? can i use a custom font? can i use a button graphic in place of text? 回答1: In general, yes to all your questions. You can subclass the various UI* classes that make up the Cocoa touch controls just like any other classes, and add your own custom

Why not use Interface Builder [closed]

爱⌒轻易说出口 提交于 2020-01-04 14:34:18
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago . I have seen some people who refuse to use Interface Builder and prefer to make everything using code. Isn't this a bit tedious and