Note that there are some explanatory texts on larger screens.

plurals
  1. POAction sheet not being dismissed
    primarykey
    data
    text
    <p>I've recently written a class that presents a custom uiactionsheet from a tablecell, in this actionsheet is a pickerview and a toolbar. When the done button on the toolbar is pressed a notifcation is sent with the choosen pickerview value and the actionsheet is dismissed. Sometimes the actionsheet vanishes from the view when the done button is pressed however it appears that the modal property of that actionsheet remains as am unable to select anything on the view that appears. Moving to another tab and coming back seems to solve this. Does anyone have any ideas what could be causing this?</p> <p>Below is the code I use to dismiss my actionsheet:</p> <pre><code>-(void)doneButtonPressed:(id)sender{ if ([[self viewWithTag:1] isKindOfClass:[PickerView class]]) { PickerView *picker = (PickerView *)[self viewWithTag:1]; if (picker.selectedRow == nil) { [picker populateSelectRowForRow:0 andComponent:0]; } NSNotification *note = [NSNotification notificationWithName:@"doneButtonPressed" object:self.indexPath userInfo:picker.selectedRow]; [[NSNotificationCenter defaultCenter] postNotification:note]; }else { DatePickerView *picker = (DatePickerView *)[self viewWithTag:1]; NSDictionary *extraInfo = [[NSDictionary alloc] initWithObjects:[[NSArray alloc] initWithObjects:[self formatDateToString:[picker date]], nil] forKeys:[[NSArray alloc] initWithObjects:@"value", nil]]; NSNotification *note = [NSNotification notificationWithName:@"doneButtonPressed" object:self.indexPath userInfo:extraInfo]; [[NSNotificationCenter defaultCenter] postNotification:note]; } [self dismissWithClickedButtonIndex:0 animated:YES]; } </code></pre> <p>and the notification method that is called:</p> <pre><code>-(void)pickerUpdate:(NSNotification *)note{ NSIndexPath *indexPath = [note object]; NSDictionary *extraInfo = [note userInfo]; NSDictionary *dict = [[tableController.sectionAndFields objectAtIndex:indexPath.section] objectAtIndex:(indexPath.row + kHeaderAndFooterOffset)]; [tableController.formDetails setObject:[extraInfo objectForKey:@"value"] forKey:[dict objectForKey:@"key"]]; NSArray *reloadArray = [[NSArray alloc] initWithObjects:indexPath, nil]; [indexPath release]; [self.tv reloadRowsAtIndexPaths:reloadArray withRowAnimation:NO]; [reloadArray release]; } </code></pre> <p>Thanks for taking the time to read this rather long post, Will</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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