• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UITextView as its own delegate - infinite loop on keyboard select
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UITextView as its own delegate - infinite loop on keyboard select


  • Subject: Re: UITextView as its own delegate - infinite loop on keyboard select
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 28 Feb 2010 17:29:40 -0800

On Sat, Feb 27, 2010 at 6:37 PM, Roland King <email@hidden> wrote:
> Thanks that's what I see too. That thread doesn't explain why of course. I
> have a trivial test case so I'll file this as a bug and see what comes back
> because I think the behaviour is wrong. For now I'm using a different object
> as delegate, which isn't so neat but works fine.

The thread does explain exactly what's going on in the UITextField
case: it sends itself messages which are also sent to the delegate.

In your case, -[UITextView keyboardInputChangedSelection:] calls [self
textViewDidChangeSelection:], which in turn asks if [self.delegate
respondsToSelector:@selector(textViewDidChangeSelection:)], which
obviously returns YES, so it calls [self.delegate
textViewDidChangeSelection:]. Because self == delegate, you infinitely
recurse.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >UITextView as its own delegate - infinite loop on keyboard select (From: Roland King <email@hidden>)
 >Re: UITextView as its own delegate - infinite loop on keyboard select (From: Kyle Sluder <email@hidden>)
 >Re: UITextView as its own delegate - infinite loop on keyboard select (From: Roland King <email@hidden>)

  • Prev by Date: Re: Carbon is C++?
  • Next by Date: Re: Using CFMutableDictionaryRef (Resolved)
  • Previous by thread: Re: UITextView as its own delegate - infinite loop on keyboard select
  • Next by thread: NSButton and NSEvent
  • Index(es):
    • Date
    • Thread