草庐IT

PhoneNumberFormatter

全部标签

iphone - 如何使用 PhoneNumberFormatter 类在 UITextField 中格式化电话号码?

我一直在查看此处有关尝试将UITextField自动格式化为电话号码的一堆主题。我看到了指向AhmedAbdelkader的PhoneNumberFormatter类(http://the-lost-beauty.blogspot.com/2010/01/auto-formatting-phone-number.html)的链接但我不明白如何实际实现它。我有两个UITextFields,我想与类一起使用,它们与许多其他UITextFields一起用于其他目的。艾哈迈德的例子是:UITextField*myTextField;intmyTextFieldSemaphore;PhoneNu