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 7504639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:38:31+00:00 2026-05-29T21:38:31+00:00

Hello! I tried to use a delegate in my app. My project uses ARC

  • 0

Hello!

I tried to use a delegate in my app. My project uses ARC

enter image description here

For example, I have protocol X and two object which uses it.
In object B I created an instance for object A and set delegate self (A.delegate = self)
In runtime I invoke a method callBack (in this point my delegate object is B). After that they all execute the -showResult method.

At what point is a circular reference formed? I understand that this is a problem with the specifier strong, but I don’t understand what time it happened, and how to track it.

Thanks!

  • 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-29T21:38:32+00:00Added an answer on May 29, 2026 at 9:38 pm

    If two objects both maintain strong references to each other (that is, they retain each other), you may have what’s known as a ‘retain cycle’ on your hands. Neither object will ever be deallocated because the other has a strong reference to it (retains it), and so it will never give up its reference (release) the other object.

    This situation is common with delegates, where one object (call it A) creates another (B) and sets itself as B’s delegate. If A has a strong reference to B so that B won’t get deallocated, and B also has a strong reference to A, you have a reference cycle. In order to avoid that, it’s common for objects not to retain or keep strong references to their delegates. Make B’s reference to A weak instead of strong and the problem goes away.

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

Sidebar

Related Questions

Hello I am developing a map view I tried to following way I created
I tried with no success: webBrowser1.Document.ExecCommand(alert('Hello World!'), true, null); also tried: private void webBrowser1_DocumentCompleted(object
I have tried to generate Hello World with openxml sdk. To my surprise when
Hello you naughty code animals.. I have tried to get this code to work,
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
I have tried to use the php script to generate PDF with a simple
Hello I have tried this many different ways and have followed the tutorial at
Possible Duplicate: replace all “foo” between () Hello, I tried to use regex to
I have tried to use the following code to retrieve the data from the
Hello i'm trying to convert my Java Object to a Json string to use

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.