Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Forget the <code>self.delegate</code> error for now, it is a red herring if <code>[self class]</code> is producing the wrong result! Your results suggest you are somehow clobbering <code>self</code>.</p> <p>Breakpoint on <code>webView:didFinishLoadForFrame:</code> check the <code>self</code> value and step through.</p> <p><strong>Comment Followup</strong></p> <p>For self to be wrong on the first statement of an instance method is, let's say, unusual (but not impossible).</p> <p>It is important when an object is set as another's delegate that you make sure the delegate object's lifetime is at least as long as the one it is acting as a delegate to. Introducing ARC can make previously working code fail as it may release the delegate earlier than the code did under MRC. When this happens the call to the delegate usually fails.</p> <p>However your error does not fail on the call to the delegate; the call starts - you end up in <code>webView:didFinishLoadForFrame:</code> - and then you find <code>self</code> is invalid. To actually invoke an instance method <em>usually</em> requires a valid value for <code>self</code> as it is used to determine the method implementation to call. Hence it is usual for <code>self</code> to be valid at the start of a method!</p> <p>But note the "usually"...</p> <p>So despite you having successfully reach your method, your error might be down to not having a strong reference to your <code>SubFoo</code> instance, you pass it as a delegate to <code>aWebView</code>, and by the time <code>webView:didFinishLoadForFrame:</code> is called your <code>SubFoo</code> has gone.</p> <p>Make sure you're keeping a strong ref to your <code>SubFoo instance</code>. If you just want to test (this is <strong>not</strong> a recommended general solution!) if this is your problem you can just assign it to a local static (<code>static SubFoo *holdMe</code> say declared inside <code>performRequest</code>) in <code>performRequest</code>, which will keep a strong reference around at least until the next call to <code>performRequest</code>. If this does prove to be the problem you then need to come up with a good way to maintain the reference that fits your design.</p>
    singulars
    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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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