• 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
first responder being clobbered
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

first responder being clobbered


  • Subject: first responder being clobbered
  • From: Michael Link <email@hidden>
  • Date: Mon, 26 Oct 2009 22:55:27 -0500

I have a custom UITableViewController that uses a custom cell that displays a text field. I have this method added to the table view controller to set the text field as first responder

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

MLPropertyEditingTableViewCell* __cell = (MLPropertyEditingTableViewCell*)[self.tableView cellForRowAtIndexPath: [NSIndexPath indexPathForRow:0 inSection:0]];

[__cell.textField becomeFirstResponder];
}


This works on iPhone OS 3.0, but not on iPhone OS 3.1. It appears that on 3.1 there is an observer that calls reloadData on the table view and that forces the first responder to resign.

#0 0x00007b9d in -[FRProjectNamePropertyEditorViewController textFieldDidEndEditing:] at FRProjectNamePropertyEditorViewController.m:131
#1 0x0030b1ea in -[UITextField fieldEditorDidResignFirstResponder:]
#2 0x00319b61 in -[UIFieldEditor resignFirstResponder]
#3 0x0030d341 in -[UITextField resignFirstResponder]
#4 0x002f4384 in -[UITableView reloadData]
#5 0x002f189f in -[UITableView layoutSubviews]
#6 0x036c62b0 in -[CALayer layoutSublayers]
#7 0x036c606f in CALayerLayoutIfNeeded
#8 0x036c58c6 in CA::Context::commit_transaction
#9 0x036c553a in CA::Transaction::commit
#10 0x036cd838 in CA::Transaction::observer_callback
#11 0x01d49252 in __CFRunLoopDoObservers
#12 0x01d4865f in CFRunLoopRunSpecific
#13 0x01d47c48 in CFRunLoopRunInMode
#14 0x0253478d in GSEventRunModal
#15 0x02534852 in GSEventRun
#16 0x002ab003 in UIApplicationMain
#17 0x00002980 in main at main.m:14


Is there a different solution to getting a first responder in a table cell and not having it resign on 3.1?

--
Michael
_______________________________________________

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


  • Follow-Ups:
    • Re: first responder being clobbered
      • From: glenn andreas <email@hidden>
    • Re: first responder being clobbered
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Transitioning to GC-supported
  • Next by Date: Re: first responder being clobbered
  • Previous by thread: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • Next by thread: Re: first responder being clobbered
  • Index(es):
    • Date
    • Thread