Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ok, this is an extremely long shot, but perhaps worth considering.</p> <p>The <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html" rel="nofollow">docs for NSData</a> state that with regards to initWithContentsOfURL "The returned object might be different than the original receiver." So, if it <em>was</em> a different object, and one which was in fact autoreleased, consider this line in your code:</p> <pre><code>adData = [[NSData alloc] initWithContentsOfURL:adURL]; </code></pre> <p>This won't add a retain count for adData -- you didn't write <code>self.adData =</code> or similar. So, bearing in mind the scenario mentioned whereby the returned NSData was autoreleased: your method downloadAdData wraps its content in an NSAutoreleasePool. This is correct practice. However, that might result in adData being released BEFORE presentAdModal is called on the main thread. So...</p> <p>In presentAdModal you just check that adData isn't nil -- but it can be not nil, and still have been deallocated from memory at that point by your NSAutoreleasePool -- hence, you <em>would</em> in this situation trigger the "show web view" code, but be attempting to load an NSData object that had been trashed. Which probably would contain complete garbage, hence no successful "web view loaded" call.</p> <p>As I said, a long shot, but the ony thing that jumps out at me at this point.</p> <p><strong>UPDATE:</strong></p> <p>A completely different cause of your problem might be this:</p> <p>Your test environment (i.e. non App-Store builds) is making requests from a certain part of the internet (i.e. your office) which has permission to access the web server containing ads, due to either IP blocking or whatever network setup there is, whereas your App Store release builds are attempting to access the ad server from parts of the internet which are forbidden. Again, probably not the case, but worth mentioning.</p>
 

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