English 中文(简体)
UIText Field可拆卸
原标题:Disable fast delete on UITextField

因此,我有代表方法。

-(BOOL)text Field:UIText Field * 外地 1. 变革者 InRange:NSRange)range supplementring:NSString *

查阅<代码>文本在其中至少具有1个特性。

如果特性数目超过20个,如果用户将第二或二次删除的纽扣吨,则删除整个字,跳上<代码>delegate,核对并删除所有方式,使之降至0。

是否有任何人知道如何将这一迅速删除?

甚至能否做到这一点,或者我看不出有体面的工作?

我也应当指出,这是用户将在这一文本中加一字。

问题回答

无。 你们会做些什么? 因此,这一方法的范围是广的,但并非单独性质。

法典

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string 

-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ 
    if (![text length]&&range.length&&range.length!=1){
        return NO;
    }




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签