Why do you generally create a weak reference when using self in a block?



Why do you generally create a weak reference when using self in a block?..

Answer / Puja Rastogi

When using 'self' inside a block, it is generally advisable to create a weak reference to avoid a strong retain cycle. A strong retain cycle can cause memory leaks as the block retains the object, and the object in turn retains the block, preventing their deallocation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

Explain difference between mrc and arc?

1 Answers  


What is difference between mvc and mvvm in ios?

1 Answers  


So how is the new look different from the old look?

1 Answers  


How much do ios developers get paid?

1 Answers  


What are all the difference between categories and subclasses in iOS operating system?

1 Answers   TryTechnicals Pvt Ltd,


What is weak in ios?

1 Answers  


What is nsmanagedobjectcontext? What are the different concurrency types? Explain them.

0 Answers  


Mention what is the use of po command in xcode?

1 Answers  


What is fast enumeration?

1 Answers  


. List down app's state transitions when it gets launched. 

1 Answers  


Is core data is thread safe?

1 Answers  


What is the difference between copies & retain in iOS operating system?

1 Answers   TryTechnicals Pvt Ltd,


Categories