-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Hi,
I am using YRDropdownView. When I show YRDropdownView any where in the view, it can hide automatically (with delay parameter set). But when YRDropdownView is triggered in a delegate function, it can't hide automatically.
Edited: To clarify the problem and give some suggestions:
I call YRDropdownView in a delegate function which is triggered when the background download is finished. The class in which it is called is in the mainthread. The problem is that it is called in a KVO function:
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context
This is not in the mainthread. So performSelector: is not working here.
[dropdown performSelector:@selector(hideUsingAnimation:) withObject:[NSNumber numberWithBool:animated] afterDelay:delay+ANIMATION_DURATION];
Suggestion: also add a mainthread test here:
if ([NSThread isMainThread]) {
//do something here
} else {
//do something here
}
Metadata
Metadata
Assignees
Labels
No labels