only character - not special/numbers from keyboard - iPhone
صفحه اصلي

only character - not special/numbers from keyboard - iPhone

Normal UITextField displays a UIKeyboard which includes alpha+Numberic+specials

But I need alpha only...

I need this because if user enters something like -- A'bad

it has a char ' -- which is affecting my query .

How we can set only alphabetic UIKeyboard to user?

Is if (variable) the same as if (variable != nil) in Objective-C


AES interoperability between .Net and iPhone?cross compiling c++ to iphone armiPhone use of mutexes with asynchronous URL requests


Cocoa-touch and UIButtonContent
I think. Why doesn't an iPhone app's main() function ever get a chance to finish?I got the answer.. Casting NSString to unsigned char * In your UIViewController file .h add delegate<UITextfieldDelegate>. Now add following code to .m file.
- (BOOL) textField:(UITextField*)textField           shouldChangeCharactersInRange:(NSRange)range           replacementString:(NSString*)textEntered {      for (int i = 0; i < [textEntered length]; i++) {         unichar c = [textEntered characterAtIndex:i];         if (![myCharSet characterIsMember:c]) {            return NO;         }     }     return YES; 


Instead of disabling or not allowing user to add ' (apostorpe) use following code,it will allow you to insert ' (apostorpe).. [textEntered stringByReplacingOccurrencesOfString:@"'" withString:@"''"];.


You should use as i did below;.
- (BOOL)textField:(UITextField *)field shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)characters {     NSMutableCharacterSet *filteredChars = [NSMutableCharacterSet letterCharacterSet];     [filteredChars formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]];     NSCharacterSet *blockedCharSet = [filteredChars invertedSet];     if (([string rangeOfCharacterFromSet:blockedCharSet].location == NSNotFound)) {           return YES;     }     return NO; } 

84 out of 100 based on 39 user ratings 594 reviews