thermogl / TITokenField

An iOS version of the NSTokenField (See To: field in Mail and Messages).
http://thermoglobalnuclearwar.com/opensource/
599 stars 172 forks source link

TITokenField layoutTokensAnimated creshes the app whiling loading mail body #87

Open Minakshi24 opened 10 years ago

Minakshi24 commented 10 years ago

My app is crashing while loading mail body, it shows me BAD_ACCESS on [self sendActionsForControlEvents:TITokenFieldControlEventFrameDidChange]; this line, tried to search solution on google but didn't found any solution.

(void)layoutTokensAnimated:(BOOL)animated {

CGFloat newHeight = [self layoutTokensInternal]; if (self.bounds.size.height != newHeight){

// Animating this seems to invoke the triple-tap-delete-key-loop-problem-thing™ [UIView animateWithDuration:(animated ? 0.3 : 0) animations:^{ [self setFrame:((CGRect){self.frame.origin, {self.bounds.size.width, newHeight}})]; [self sendActionsForControlEvents:TITokenFieldControlEventFrameWillChange];

} completion:^(BOOL complete){ if (complete) { [self sendActionsForControlEvents:TITokenFieldControlEventFrameDidChange]; } }]; } }