Questions tagged [nstextfield]

NSTextField object belongs to Apple's class. It's a kind of NSControl that displays text that the user can edit or select.

An NSTextField object is a kind of NSControl () that displays text that the user can select or edit and that sends its action message to its target when the user presses the Return key while editing.

The NSTextField () class uses the NSTextFieldCell () class to implement its user interface.

References:

1028 questions
0
votes
2 answers

Why does the value of only one of my text fields change?

I have the following code: @interface AXWindowController : NSWindowController { IBOutlet NSTextField *text; IBOutlet NSTextField *otherText; } - (void) setText: (NSString *)input; - (void) setOtherText; @end @implementation AXWindowController -…
Chetan
  • 46,743
  • 31
  • 106
  • 145
0
votes
1 answer

NSTextField, NSNumberFormatter nil input validation and handling

In IB i inserted a configured NSNumberFormatter to the NSTextField, which validates users number input All works fine, when i input a text or a number which is too large - i get the warning prompt However, when the user deletes the value using back,…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
0
votes
1 answer

Saving NSTextField properties based on NSPopUpButton selection using NSUserDefaults

I have added an option to my app to change the background color and textColor of an NSTextField. I set up an NSPopUpButton and based on the selected item in the NSPopUpButton, it changes the colors. I want to save this selection using…
Sega dude
  • 1,103
  • 3
  • 12
  • 29
0
votes
1 answer

NSTextField and NSTextView : Overlapping Delegate Methods

I have a class which was the delegate for NSTextViews, for which I was interested in the textDidEndEditing: method. I now want it to also be the delegate for NSTextFields. Problem is, they both use the same method for signaling end of text…
Bertrand Caron
  • 2,525
  • 2
  • 22
  • 49
0
votes
1 answer

NSTextField with NSNumberFormatter - not allow nil value

I have a NSTextField with a NSNumberFormatter. I set the formatter with a min of 0 (because I couldn't set it to 0.01), and the style to decimal. The NSTextField has a binding on its value with a float ivar, and the action is set to "Send On Enter…
0
votes
0 answers

NSTextfield storing in core data

i have a NSdatepicker and when i change the year, it changes another NSTextFile´s value to the number of years till now like this: - ( IBAction)setExp:(id)sender { NSDateFormatter *df = [NSDateFormatter new]; [df setDateFormat:@"yyyy"]; NSString…
Skovie
  • 197
  • 3
  • 18
0
votes
1 answer

Input in menu item?

I would like to know if it is possible to have a NSTextField (for example) as a menu item in a menu. Your help will be very appreciated! Sweet day, —Albé
Donovan
  • 6,002
  • 5
  • 41
  • 55
0
votes
1 answer

controlTextDidBeginEditing is not being called when NSTextField is selected

controlTextDidBeginEditing delegate method is not being called when NSTextfield is selected by clicking or by pressing tab.The delegate is set and all other delegate methods are fired.Any suggestions??
sujith1406
  • 2,822
  • 6
  • 40
  • 60
0
votes
1 answer

How can I get noticed when subclassed NSSecureTextField get focus each time?

I subclassed NSSecureTextField, and overrided -(BOOL)becomeFirstResponder,but it only works well when my custom NSSecureTextField get focus at the first time.
0
votes
1 answer

How to disable pasting password into NSSecureTextField

I've been working on it for a long time, and tried following two methods.However, neither succeeds. subclassing NSSecureTextField and overriding -(BOOL)becomeFirstResponder and -(void)textDidEndEditing:. -(BOOL) becomeFirstResponder { NSMenu…
Gaojin
  • 1
  • 2
0
votes
2 answers

How to add a NSTextField to a window in the window's init via a method

I want to programatically add several NSTextFields to a window when it loads. I call the below method for each one in the init such as: - (id)initWithWindow:(NSWindow *)window{ [self addTextField:firstTextField toWindow:window…
0
votes
0 answers

Can't use NSTextField delegate in NSDocument

I have a document-based project with a view-based tableView bound to a coreData Entity. Now I'd like to use the delegate controlTextDidChange: with a static text inside a tableViewColumn. What I'v done is adding NSTextFieldDelegate to my…
0
votes
1 answer

NSTextFields Positioned Lower On Other Macs

This is a weird situation. In Xcode's IB, I have a NSTableCellView subclass that I've built. It looks like this: And when I run the app on my Mac, it comes out exactly as I would expect: However, if any other Mac runs my app, every text field…
Aaron Vegh
  • 5,217
  • 7
  • 48
  • 75
0
votes
2 answers

Make NSTextField update its bound value when setting its string value programmatically

I have an NSTextField bound to a key in the user defaults. When I press enter or leave the field the bound value is properly updated (I have an observer for it). However when I programmatically set the value of the text field the bound value is not…
Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
0
votes
1 answer

OSX - After using controlTextDidEndEditing:notification , how do I get focus

I want to be able to edit some NSTextFields that are bound in an NSCollectionView. I'm getting notified through controlTextDidEndEditing:(NSNotification *)notification and I can edit fields within one record. However, when I want to edit another…
ICL1901
  • 7,632
  • 14
  • 90
  • 138