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
1 answer

Setting label stringValue of NSTextField using Objective-C, property IBOutlet NSTextField exist in separate class

To start off with I am very new, (about 2.5 weeks) to programming in Objective-C and even newer to writing code for OS X cocoa apps. I am attempting to set the value of a NSTextField label in AppDelegate.m whose IBOutlet property exists in another…
0
votes
0 answers

Set max length for mutiple NStextfield in Cocoa

I create multiple NSTextField in XIB, now I want to set max lengh for each NSTextField. How can I do that by best way?
NML611
  • 27
  • 7
0
votes
1 answer

Get value of NSTextfield by tag number in Cocoa

I have a problem : How can i do If i want get value of NSTextField by tag number? I create NSTextField dynamically and set tag for it by this code : for(int i=0; i
NML611
  • 27
  • 7
0
votes
2 answers

How to get value of NSTextField dynamic add to NSMutableArray?

I have a Combobox contains 30 items (1,2,...,30). I want to select item in Combobox, create dynamic NSTextField same item selected in Combobox. Then user input text to NSTextField, and then click on button to get all text of each NSTextField add to…
HTKT611
  • 161
  • 1
  • 1
  • 11
0
votes
1 answer

Can I set a property when created with bindings?

I'm trying to build a To-do list application. I have 2 tablesviews and one textfield. In the first tableview are the different projects, and when you click on one of them the associated todos appear in the second tableview. It's a pretty basic…
Max
  • 3
  • 1
0
votes
2 answers

Drawing in NStextField

If you wanted to implement a highlighting for specific substrings in a NSTextField like on the screenshot (Tweetie.app) how would you do it? :) Tweetie Link Highlighting http://qkpic.com/88c61 Thanks for your help!
papr
  • 4,717
  • 5
  • 30
  • 38
0
votes
1 answer

Enabled binding for NSTextField bound to NSString

@interface MyClass { NSString *_myString; } @property (copy) *myString; @end @implementation MyClass @synthesize myString = _myString; - (void)awakeFromNib { self.myString = @""; } In the nib, I have an NSTextField and an NSButton. The text…
Colin
  • 2,089
  • 25
  • 34
0
votes
1 answer

NSTextField arrow keys do not move the caret

I kind of expected this to be the default behaviour for the NSTextField to automatically respond to left/right arrow key with caret movement. Unfortunately, in my app this does not happen. Is there an option to turn that behaviour on or do I have to…
Bikush
  • 654
  • 8
  • 22
0
votes
2 answers

convert NSTextField to Label

I am using following functions for converting textfield to label and vice versa -(void)convertLabelToTextField : (NSTextField *)Inlabel { [Inlabel setBezeled:YES]; [Inlabel setDrawsBackground:YES]; [Inlabel setEditable:YES]; …
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
0
votes
1 answer

NSTextField isFirstResponder

I'm trying to perform what I presume is quite a simple task in Cocoa, (Mac OSX 10.8), which is to paste a string from the clipboard into an NSTextField. I know how to access the string currently being held in the clipboard, but my problem at the…
Mike
  • 155
  • 2
  • 13
0
votes
3 answers

Call NSObject method from NSTextField Subclass?

I'm having trouble calling an external method from a NSTextField Subclass. I have a NSTextField subclass that I'm monitoring text with and when textDidChange I'm calling an external method that is of a NSObject class. For some reason my method…
0SX
  • 1,252
  • 6
  • 24
  • 47
0
votes
1 answer

getting multiple integer values out of textfield

I want to read many different integer values out of an textfield and for that I have this code: NSString *string1,*string2; string1= [textField stringValue]; int i,c; c=0; NSInteger values[50]; for (i=0; i<50; ) { string2=[NSString…
killerwakka
  • 31
  • 2
  • 9
0
votes
0 answers

Why is controlTextDidEndEditing being called when I send setEditable?

//1: -(void) TextFieldEdit:(CDTextField *)textField{ [textField setEditable:YES]; } //2: - (void)controlTextDidEndEditing:(NSNotification *)aNotification{ NSTextField* textField = (NSTextField *)[aNotification object]; [textField…
DaoYan.Tang
  • 77
  • 1
  • 6
0
votes
1 answer

Key Down With Multiple Controls

I understand that you use (BOOL)control:(NSControl *)control textView:(NSTextView *)inputfield doCommandBySelector:(SEL)commandSelector to detect the key for NSTextView and NSTextField that the user has pressed like the following. -…
El Tomato
  • 6,479
  • 6
  • 46
  • 75
0
votes
2 answers

Relationship between Font size and Label size in Xcode

When dragging a Label into .xib file in Xcode, I noticed two "sizes": Font size of the label text and the size of the NSTextField instance itself. If I want to display the text in different font size (for example, from "Lucida Grande 13" to "Lucida…
Andrew Chang
  • 1,289
  • 1
  • 18
  • 38