Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can this Xcode Clang static analyzer warning be suppressed?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COIt strikes me as odd that an object's delegate retains it. Typically, an object retains it's delegate, and to have the delegate retain the object would make a retain cycle. I'm not saying there are ZERO cases where a delegate might want to retain (perhaps short-lived) the object, but it would seem relevant to know why that's the case here. From what's been said here, I'd say it's more kosher for the object to retain itself for the duration of the operation and subsequent delegate message than for the delegate to "take ownership of" the alloc/init implied retain.
      singulars
    2. CO@ipmcc: While it is possible for an object to retain its delegate, and there are a few places in SDK where a class does just that, I would say it is more common to store a delegate as a weak reference, to avoid the retain cycle you mention. Either way, it is definitely not "typical" for an object to retain its delegate. In my case, some class created an object with alloc/init and and set itself as the delegate. As the owner of the class, the delegate later releases the object when the it is done. There is no contrived ownership happening here.
      singulars
    3. CO@ipmcc - Matt is correct, the normal pattern is: Object A creates Object B and sets itself as Object B's delegate. Object A retains Object B. When Object A gets dealloced, it makes sure to unset itself as Object B's delegate, otherwise you may crash.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload