首页 > 其他 > 详细

notes

时间:2014-04-21 18:03:07      阅读:698      评论:0      收藏:0      [点我收藏+]

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text

{

if([text isEqualToString:@"\n"])

{

[textquestionendEditing:YES];

if(textquestion.text.length == 0)

[selfSetPlaceholder];

returnNO;

}

    

    

    if([text length]==0)

    {

        NSLog(@"yulang");

        NSRange range=[textquestion.textrangeOfString:@"@"options:NSBackwardsSearch];

        NSLog(@" location=%d,length=%d",range.location,range.length);

        NSString *str=[textquestion.textsubstringFromIndex:range.location];

        NSString *str1=[textquestion.textsubstringToIndex:range.location-1];

        if([str isEqual:@"@yu"])

            textquestion.text=str1;

    }

    

returnYES;

}

notes,布布扣,bubuko.com

notes

原文:http://www.cnblogs.com/yulang314/p/3677490.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!