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

  • Home
  • SEARCH
  • 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 9206569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:12:13+00:00 2026-06-18T00:12:13+00:00

How can I avoid this warning in xcode. Here is the code snippet: [player(AVPlayer

  • 0

How can I avoid this warning in xcode. Here is the code snippet:

[player(AVPlayer object) addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(0.1, 100)
queue:nil usingBlock:^(CMTime time) {
    current+=1;

    if(current==60)
    {
        min+=(current/60);
        current = 0;
    }

    [timerDisp(UILabel) setText:[NSString stringWithFormat:@"%02d:%02d",min,current]];///warning occurs in this line
}];
  • 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-06-18T00:12:14+00:00Added an answer on June 18, 2026 at 12:12 am

    The capture of self here is coming in with your implicit property access of self.timerDisp – you can’t refer to self or properties on self from within a block that will be strongly retained by self.

    You can get around this by creating a weak reference to self before accessing timerDisp inside your block:

    __weak typeof(self) weakSelf = self;
    [player addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(0.1, 100)
                                         queue:nil
                                    usingBlock:^(CMTime time) {
                                                    current+=1;
    
                                                    if(current==60)
                                                    {
                                                        min+=(current/60);
                                                        current = 0;
                                                    }
    
                                                     [weakSelf.timerDisp setText:[NSString stringWithFormat:@"%02d:%02d",min,current]];
                                                }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can I avoid this in jQuery: $(this).parents(.node-inner).children().children().children(); I tried: $(this).parents(.node-inner).children(.className); but it doesn't
Can I avoid instantiate a Db object inside of Names object to access it
Can I avoid third party code from creating new threads, starting new VMs, or
does anybody know how this warning can be suppressed? there is no way for
I know there are a lot of how do I avoid this warning questions,
Whenever I run my code: $perl my_any_code.pl It always gives me this: perl: warning:
I know in Jenkins you can avoid duplicate builds from running on top of
Is there any way I can avoid using array_flip to optimize performance. I am
I read of a useful trick about how you can avoid using the wrong
Can I avoid the open DataReader exception (There is already an open DataReader associated

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.