Note that there are some explanatory texts on larger screens.

plurals
  1. POBottom toolbar buttons flashes for a second?
    primarykey
    data
    text
    <p>this little issue is really getting on me.</p> <p>I have hierarchal navigation controller: RootView-->2ndListView-->DetailView</p> <p>I implemented bottom toolbar with buttons easily on the DetailView. Works perfectly there.</p> <p>However, in the 2ndListView, when I follow the same thing and put the following code in either viewdidload or viewwillappear or any other similar method, the button just flashes for a second when the view loads, and then hides.</p> <p>Instead, if I put up this code in cellForRowAtPathIndex (so that nothing is executed after that), it does work. But this is obviously very inefficient.</p> <p>So there is something happening in between. What could be the issue?</p> <pre><code>NSMutableArray *array; NSMutableArray *tags; @implementation SMSListViewController @synthesize smses,catID,addButtonItem,filteredSMS,searchBar,searchController; -(void)getStarted{ array = [[NSMutableArray alloc] init]; tags = [[NSMutableArray alloc] init]; SMSDBAccess *smsDBAccess = [[SMSDBAccess alloc] init]; smsDBAccess.catID = self.catID; self.smses = [smsDBAccess getAllItems]; [smsDBAccess closeDatabase]; [smsDBAccess release]; } - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } - (void)dealloc { [array release]; [smses release]; [super dealloc]; } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController setToolbarHidden:NO]; self.navigationItem.rightBarButtonItem = self.editButtonItem; UIBarButtonItem *addSMSButoon = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(addSMS:)]; UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; NSArray *buttons = [NSArray arrayWithObjects:space,addSMSButoon, nil]; [self.navigationController.toolbar setItems:buttons animated:NO]; [addSMSButoon release]; [space release]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self getStarted]; [self.tableView reloadData]; } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [smses count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... SMS *aSMS = [self.smses objectAtIndex:indexPath.row]; cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator; cell.textLabel.text =aSMS.sms; cell.detailTextLabel.text=aSMS.sms; return cell; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload