• 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: NSSecureTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSecureTextField


  • Subject: Re: NSSecureTextField
  • From: j o a r <email@hidden>
  • Date: Thu, 30 Oct 2003 08:16:43 +0100

On 2003-10-30, at 07.14, Sean Liong wrote:

[passwordField setStringValue: [NSString stringWithFormat:@"" ]];

No, don't do it this way! If you need to create an empty string, and a constant string isn't good enough for some reason, you would do it like this (most often used for mutable strings, as it's pretty pointless for immutable strings):

NSString *str = [NSString string];

I'm not advocating in in this case though, as the original code snippet *should* work as is.

To troubleshoot:

Can you *get* the string value from the secure text field? Try this:

NSLog(@"secure text field contents: %@", [passwordField stringValue]);

Does it print what you expect? If not, you might have some problem with your connection to the secure text field. Perhaps you need to end editing in the text fields before clearing their values, something like this:

- (void) endEditing
{
if (![myWindow makeFirstResponder: myWindow])
{
[myWindow endEditingFor: nil];
}
}

- (IBAction) clear:(id) sender
{
[self endEditing];

[mySecureTextField setStringValue: @""];
}

j o a r
_______________________________________________
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.

References: 
 >Re: NSSecureTextField (From: "Sean Liong" <email@hidden>)

  • Prev by Date: Re: Plugins work in PB, but not in standalone
  • Next by Date: Re: NSTextField to be selected
  • Previous by thread: Re: NSSecureTextField
  • Next by thread: ZeroLink error?
  • Index(es):
    • Date
    • Thread