开发者

TTTextBarController character count

开发者 https://www.devze.com 2023-01-05 00:52 出处:网络
i am using TTTextBarController开发者_运维问答 from Three20 library. i want to count the number of characters,which user going to write in this control.

i am using TTTextBarController开发者_运维问答 from Three20 library.

i want to count the number of characters,which user going to write in this control. And have to limit maximum number of character to 500. User should not exceed than the 500 characters.

How can i achieve this.

Regards


Solved

int len = textBar.textEditor.text.length;
NSLog(@" len = %d", len);
if (len >=160) {
    //do something here
} else {
    //do something here
}
0

精彩评论

暂无评论...
验证码 换一张
取 消