Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)changeDefaultView:(NSNotification *)note
- {
- [self closePopover];
- int i;
- for(i = 0; i < [arrWebViewControllers count]; i++)
- {
- WebViewController *wvc = [arrWebViewControllers objectAtIndex:i];
- [[wvc webview] stopLoading];
- [[wvc webview] removeFromSuperview];
- [[wvc imageview] removeFromSuperview];
- wvc = nil;
- }
- [arrWebViewControllers removeAllObjects];
- [arrLinks removeAllObjects];
- [arrImageViews removeAllObjects];
- [self loadCategory:[note object]];
- [self addWidgetsToView];
- }
- - (void)closePopover
- {
- if(popover != nil)
- {
- [popover dismissPopoverAnimated:YES];
- popover = nil;
- }
- }
- - (void)changeDefaultView:(NSNotification *)note
- {
- [self closePopover];
- int i;
- for(i = 0; i < [arrWebViewControllers count]; i++)
- {
- WebViewController *wvc = [arrWebViewControllers objectAtIndex:i];
- [[wvc webview] stopLoading];
- [[wvc webview] removeFromSuperview];
- [[wvc imageview] removeFromSuperview];
- wvc = nil;
- }
- [arrWebViewControllers removeAllObjects];
- [arrLinks removeAllObjects];
- [arrImageViews removeAllObjects];
- // perform the expensive operation on a background thread
- dispatch_async(dispatch_get_global_queue(0, 0), ^{
- [self loadCategory:[note object]];
- // now get back onto the main thread to perform our UI update
- dispatch_async(dispatch_get_main_queue(), ^{
- [self addWidgetsToView];
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement