Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I know it sounds obvious, but is everything connected correctly in Interface Builder?</p> <p><strong>Edit</strong></p> <p>If the download is on a separate thread, then fbrereto is correct and you'll need to perform the selector on the main thread. Your code would need to be changed to look like this:</p> <pre><code>[downloadButton performSelectorOnMainThread:@selector(setEnabled:) withObject:[NSNumber numberWithBool:NO] waitUntilDone:YES]; </code></pre> <p>A few notes: in Objective-C the keyword <code>NO</code> is used instead of <code>FALSE</code>. It's a primitive type, so in order to use it here we had to box it in a <code>NSNumber</code> object. The <code>waitUntilDone</code> argument does exactly what you would expect, and you can change that to <code>NO</code> if you'd rather not wait.</p> <p><strong>Edit 2</strong></p> <p>Here's a more complete code example about how to accomplish what I think you want, which is to reuse a single instance of GrooveOnDownload from your app delegate. I'm assuming that your app delegate class is called GrooveOnLiteAppDelegate.</p> <pre><code>// GrooveOnLiteAppDelegate.h @interface GrooveOnLiteAppDelegate : NSObject { IBOutlet GrooveOnDownload *grooveOnDownload; // other properties go here } // your method signatures go here @end // GrooveOnLiteAppDelegate.m @implementation GrooveOnLiteAppDelegate - (void)mySuperAwesomeMethod { // it's up to you to figure out what method to put this in and // how to call it NSURLDownload *dw = [[NSURLDownload alloc] initWithRequest:request delegate:grooveOnDownload]; } @end </code></pre> <p>Given that code in your app delegate, you'll have an outlet in IB that you can connect to your GrooveOnDownload object in IB. If you do that, then <code>grooveOnDownload</code> will be a pointer to that object.</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