Setting the receiving textfield in code
Setting the receiving textfield in code
- Subject: Setting the receiving textfield in code
- From: <email@hidden>
- Date: Sat, 20 Jul 2002 21:30:38 +0200
- Thread-topic: Setting the receiving textfield in code
Hi all,
I'm trying to accomplish the following idea:
I've got a string cotaining a certain word, say of 5 characters (i. e. APPLE).
In my window I've got 5 textfield (say textField1 thru 5).
Now what I want is to have every character be placed in a single textfield; so A in textField1
I'd like to do it in a "for loop" because some checking on the characters has to be done.
The problem is that I want to do something like:
for (i = 0; i < 6; i++) {
[receiver setStringValue: character];
}
where receiver would be something like [NSString stringWithFormat: @"textField%d", i+1];
and character would be the common way to get character i from my string
In both cases I run into obvious troubles, but I couldn't find a solution.
How do I set the receiver, composited from a string??
And what is the best way to get my character and put in a string,
I tried the characterAtIndex: method, but that returns a character and not a string,
even more I tried substringWithRange: (NSRange) aRange, but didn't get the syntax right
Any help, comments and examples are highly appreciated!!
Alex
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.