Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ruhi

macrumors member
Original poster
Jun 17, 2009
70
0
Hello,

I have made a subclass of NSTextField and trapped all keyup events on the textfield that my nib file has.

Problem is when i try to set any text into the text field in one of the button click event.

Code:
-(IBAction)setData: (id)sender
{
       [mytextField setStringValue:str];
}

i cannot see any string in my textfield. Why is this so? :confused::confused:

Thanks,
Ruhi.
 
Hello,

I have made a subclass of NSTextField and trapped all keyup events on the textfield that my nib file has.

Problem is when i try to set any text into the text field in one of the button click event.

Code:
-(IBAction)setData: (id)sender
{
       [mytextField setStringValue:str];
}

i cannot see any string in my textfield. Why is this so? :confused::confused:

Thanks,
Ruhi.

so you're using the keyEvent to check for key strokes? What are you trying to achieve? What button do you click and why do you do it that way?
 
I've had a look on google for you and people are saying that you need to update your view after changing the values. Try this and see.

Stephen
 
subclassing NSTextField

Thanks for the concern.

But i got the solution now.

I just have to write [self setStringValue:mad:"test"] after setting the class of textfield as my class which is subclass of NSTextField.

Thanks,
ruhi.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.