iphone - using completion with animateWithDuration causes exc_bad_access -


i trying animate 2 uibuttons in uitableviewcell called addtoplaylist , removefromplaylist (they animate off right after being swiped on) , using block follows

[uiview animatewithduration:0.25 animations:^{      self.addtoplaylist.center      = cgpointmake(contentssize.width + (buttonsize.width / 2), (buttonsize.height / 2));     self.removefromplaylist.center = cgpointmake(contentssize.width + (buttonsize.width / 2), (buttonsize.height / 2));     myimage.alpha = 1.0;  }  completion:^ (bool finished)   {      if (finished) {          // revert image view original.          nslog(@"is completed");          self.addtoplaylist.hidden       = yes;          self.removefromplaylist.hidden  = yes;          self.hasswipeopen               = no;      }  }]; 

on completion want hide buttons attempt lessen redraw on scroll etc.

this code sits within '-(void) swipeoff' called in uitableviewcontrollers method scrollviewwillbegindragging so:

- (void)scrollviewwillbegindragging:(uiscrollview *) scrollview {    (mediacellview* cell in [self.tableview visiblecells]) {         if (cell.hasswipeopen) {            [cell swipeoff];         }     } } 

the problem completion code, if remove or set nil good, if include exc_bad_access. if include or of lines within if(finished) commented out

am using in wrong way, appreciated.

thanks

i had same problem animations. i've solved removing -weak_library /usr/lib/libsystem.b.dylib other linker flags.

also, according this answer, if need flag, may replace -weak-lsystem.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -