self.delegate = self;
what\'s wrong in doing that?
and what is the correct way of doing it?
Thanks, Nir.
Code:
(UITextField*)initWi
See this thread
http://www.cocoabuilder.com/archive/cocoa/241465-iphone-why-can-a-uitextfield-be-its-own-delegate.html#241505
Basically, the reason for the "freeze" when you click on your UITextField with itself as a delegate is that respondsToSelector
is calling itself -> infinite recursion.
UITextField is unique AFAIK. You can usually use a class as its own delegate with no particular problems. For UITextField you must create an actual delegate (that could, of course, call methods on the UITextField for which it's a delegate. Just be careful to avoid retain loops, even if you're using ARC).