Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This line is garbage:</p> <pre><code>[request setDidFinishSelector:[self performSelector:@selector(imageDownloaded:idPlace:)withObject:request withObject:place.idPlace]]; </code></pre> <p>This should be throwing a compiler warning at the very least. You're executing <code>-imageDownloaded:idPlace:</code> immediately, and then taking the result (which in your case is going to be whatever garbage value was on the stack) and returning that as the selector. the response data is nil because you're actually executing your <code>imageDownloaded:</code> method before the request even runs.</p> <p>Assuming ASIHTTPRequest only accepts didFinishSelectors of the form <code>foo:</code> (e.g. one argument), then there's no good way to do what you're trying to do, which is to attach a second argument onto the method. That simply won't work. You have a few alternatives, but the simplest one is probably to make use of ObjC Associated Objects. You can hang your <code>place.idPlace</code> object off of the request and get at it later.</p> <p>At the top of your file, define a key:</p> <pre><code>static char kAssociationKey; // we just want its memory location </code></pre> <p>Then when you start the request you can run:</p> <pre><code>objc_setAssociatedObject(request, &amp;kAssociationKey, place.idPlace, OBJC_ASSOCIATION_RETAIN_NONATOMIC); [request setDidFinishSelector:@selector(imageDownloaded:)]; </code></pre> <p>This will attach <code>place.idPlace</code> to the request object. Then in your didFinishSelector you can run</p> <pre><code>id oldIdPlace = objc_getAssociatedObject(request, &amp;kAssociationKey); </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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