NSString string
NSString string
- Subject: NSString string
- From: "Stephen C. Jensen" <email@hidden>
- Date: Thu, 25 Sep 2003 16:05:33 -0700
I think I've found a bug in stringByTrimmingCharactersInSet...
I have a text field named "FirstNameField" in which the user can type
in a name for searching. You can type in one or more letters, and the
search algorithm will match whatever you know. What I discovered was
that if you type in a search string and a space, the search algorithm
returns nothing. No problem... I put in a
"stringByTrimmingCharactersInSet" command while querying the field,
like so:
[options appendString: [[FirstNameField stringValue]
stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]]];
NSLog(@"FirstNameField: %@\n",
[[FirstNameField stringValue] stringByTrimmingCharactersInSet:
[NSCharacterSet
whitespaceCharacterSet]]);
NSLog(@"FirstNameField: %@\n", [FirstNameField stringValue]);
When I put in two or more letters into the field, it works fine:
2003-09-25 16:04:31.582 MegaPhone[1227] FirstNameField: St
2003-09-25 16:04:31.582 MegaPhone[1227] FirstNameField: St
When I put in a single letter, it doesn't:
2003-09-25 16:05:01.412 MegaPhone[1227] FirstNameField:
2003-09-25 16:05:01.413 MegaPhone[1227] FirstNameField: S
The single letter is trimmed. This doesn't make sense. Any ideas?
Thanks!
--
_______________________________________________
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.