Skip to content

Instantly share code, notes, and snippets.

@aug2uag
Created February 2, 2014 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aug2uag/8763107 to your computer and use it in GitHub Desktop.
Save aug2uag/8763107 to your computer and use it in GitHub Desktop.
Incompatible block pointer types
- (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