Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7574787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:31:22+00:00 2026-05-30T16:31:22+00:00

I get this warning in Xcode warning: Attempting to create USE_BLOCK_IN_FRAME variable with block

  • 0

I get this warning in Xcode

warning: Attempting to create USE_BLOCK_IN_FRAME variable with block
that isn’t in the frame.

Xcode redirect me to my NSStream

_naturStream = [[NSInputStream alloc] initWithData:natur];

It is random when it does this error, and my application crashes when it is triggered. Anyone tried similar problem ?

thanks

EDIT

in the appDelegate.h

@property (nonatomic, strong) NSInputStream *naturStream;

In the appDelegate.m:

  NSData *natur = [NSData dataWithContentsOfURL:[NSURL URLWithString:_locString]];
    
    _naturStream = [[NSInputStream alloc] initWithData:natur];
    
    [_naturStream open];
    
    
    
    if (_naturStream) {
    
        NSError *parseError = nil;
        id jsonObject = [NSJSONSerialization JSONObjectWithStream:_naturStream options:NSJSONReadingAllowFragments error:&parseError];        
        if ([jsonObject respondsToSelector:@selector(objectForKey:)]) {
            for (NSDictionary *natur in [jsonObject objectForKey:@"results"]) {
              
                _poi  = [[POI alloc]init];
                [_poi setTitle:[natur objectForKey:@"title"]];
                [_poi setLat:[[natur objectForKey:@"lat"]floatValue]];
                [_poi setLon:[[natur objectForKey:@"lng"]floatValue]];
                [_poi setDistance:[natur objectForKey:@"distance"]];
                [_poi setWebUrl:[natur objectForKey:@"webpage"]];
                
                [_naturArray addObject:_poi];
            }    
        }
    } 
    else {
        
        NSLog(@"Failed to open stream.");
    }
    
    [_naturStream close];
}

I realized that i forgot [_naturStream close] i don’t know if it has solved the problem or not ?

EDIT

Another thing,…. I use a Thread for fetching the JSON data:

dispatch_queue_t jsonParsingQueue = dispatch_queue_create("jsonParsingQueue", NULL);
    
    // execute a task on that queue asynchronously
    dispatch_async(jsonParsingQueue, ^{
        [self parseJSON];


    dispatch_async(dispatch_get_main_queue(), ^{
        
        [_kortvisning updateAnno];
        [visListe updateList];
            
             });
    });
    
    // release the dispatch queue
    dispatch_release(jsonParsingQueue);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:31:24+00:00Added an answer on May 30, 2026 at 4:31 pm

    Sounds like you’re using ARC – if _naturStream is an instance variable for an objective C class, you might need to pull it out and add a __block reference so that ARC knows the scope correctly – but I’m guessing because I don’t see how the block is used with the NSInputStream (if you post that part we might know). A good bit is here: http://nachbaur.com/blog/using-gcd-and-blocks-effectively

    — edit —

    Ok, now that you posted the rest, I bet it has to do with the _kortvisning and visListe variables. I think you want to pull those out right after you create your queue something like

    __block KortVisning *localKortVisning = _kortvisning;
    __block NSMutableArray *localVisListe = visListe;
    

    Then access those directly from your final completion handler you’re sending back to the main queue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cant understand what this warning I get on Xcode is about. Searching for
When I am building packages on Gentoo. I get this warning that '-ggdb3' flag
How do I get rid of this linker warning that appears every time I
Why do I get this warning in Xcode 4.3.1? Thanks.
I get this warning from GCC: warning: cannot pass objects of non-POD type 'class
I get this: Warning: session_start(): Cannot send session cookie - headers already sent by
I get this warning in my error logs and wanted to know how to
Does anybody know why I get this warning when I turn off the auto-commit
This is actually a non-critical question, but I get this warning most of the
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.