• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Setting the receiving textfield in code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Setting the receiving textfield in code


  • Subject: RE: Setting the receiving textfield in code
  • From: <email@hidden>
  • Date: Sun, 21 Jul 2002 00:18:30 +0200
  • Thread-topic: Setting the receiving textfield in code

Nico,

>You can't use [NSString stringWithFormat:..........] like that, your
>NSTextField is not an NSString :P
>You might want to use [self valueForKey:[NSString
>stringWithFormat:...............]] instead : there you directly access
>to your instance variable.

>You can so use your modified code :
>for (i = 0; i < 6; i++) {
[[self valueForKey:[NSString stringWithFormat: @"textField%d", i+1]]
setStringValue:[myString characterAtIndex:i]];
}


That was exactly the construction I was looking for!! Thanks!
I knew my initial attempts weren't working because I was directing the string instead of the textfield,
and I just knew it should be possible, but then where to look?? Again thanks for the hint, I'll try to see if I get it to work now...

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.

  • Prev by Date: Setting the receiving textfield in code
  • Next by Date: Error question
  • Previous by thread: Setting the receiving textfield in code
  • Next by thread: Custom drawing in an NSTextField
  • Index(es):
    • Date
    • Thread