Created
February 2, 2014 04:34
-
-
Save aug2uag/8763107 to your computer and use it in GitHub Desktop.
Incompatible block pointer types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)setMore | |
{ | |
BOOL moreExist = NO; | |
if (foo || bar) | |
{ | |
moreExist = YES; | |
[NSURLConnection sendAsynchronousRequest:[NSURLRequest | |
requestWithURL: [NSURL URLWithString:url]] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
if (data) { | |
newStr = [[NSString alloc] initWithData:data | |
encoding:NSUTF8StringEncoding]; | |
if(!newStr) | |
{ | |
newStr = [[NSString alloc] initWithData:data | |
encoding:NSASCIIStringEncoding]; | |
} | |
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; | |
// [self.navigationController setToolbarHidden: YES animated: YES]; | |
[webView setDelegate:(id)self]; | |
NSURL *ddurl = [NSURL URLWithString:newStr]; | |
NSURLRequest *requestObj = [NSURLRequest requestWithURL:ddurl]; | |
progress = [[MBProgressHUD alloc]init]; | |
[[NSOperationQueue mainQueue] addOperationWithBlock:^{ | |
[progress show:YES]; | |
[webView loadRequest:requestObj]; | |
[self.view addSubview:webView]; | |
[self.view addSubview:progress]; | |
}]; | |
} | |
}]; | |
} | |
else | |
{ | |
moreExist = YES; | |
[NSURLConnection sendAsynchronousRequest:[NSURLRequest | |
requestWithURL: [NSURL URLWithString:url]] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
if (data) { | |
// something else | |
return moreExist; | |
} | |
}]; | |
} | |
return moreExist; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment