Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 813705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:24:14+00:00 2026-05-15T01:24:14+00:00

I got this code: GrooveOnDownload *dlg = [[GrooveOnDownload alloc] init]; NSURLDownload *dw = [[NSURLDownload

  • 0

I got this code:

GrooveOnDownload *dlg = [[GrooveOnDownload alloc] init];

NSURLDownload *dw = [[NSURLDownload alloc] initWithRequest:request delegate:dlg];

It starts the download in a delegate class with outlets for UI controls. But for some reason controls don’t respond to direct messages from the delegate.

//Header of the delegate
@interface GrooveOnDownload : NSObject {
IBOutlet id downloadButton;
//...

//Implementation 
//...
[downloadButton setEnabled:FALSE]; // Doesn't work
//...

Any ideas?

It is my fourth day of Mac development so I don’t know much about the platform.

Edit : 2010-05-28 01:03:41.486 GrooveOnLite[3303:a0f] Download button = (null)

Edit 2 :

alt text

Edit 3 :
I miss Windows …..

Edit 4
In Win32 you send one window message to the button. Everything is handled by WndProc loop. It is damn simple. In Mac you have this magical interface builder which somehow gets all that crap working. The delegate gets called by some withcraft magic. The rest of the classes are connected by some ‘magical’ force. In windows there is an tmain function which is the entry point. That’s it! No retarded outlets and such shit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:24:15+00:00Added an answer on May 15, 2026 at 1:24 am

    I know it sounds obvious, but is everything connected correctly in Interface Builder?

    Edit

    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:

    [downloadButton performSelectorOnMainThread:@selector(setEnabled:)
        withObject:[NSNumber numberWithBool:NO]
        waitUntilDone:YES];
    

    A few notes: in Objective-C the keyword NO is used instead of FALSE. It’s a primitive type, so in order to use it here we had to box it in a NSNumber object. The waitUntilDone argument does exactly what you would expect, and you can change that to NO if you’d rather not wait.

    Edit 2

    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.

    // 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
    

    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 grooveOnDownload will be a pointer to that object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this code: rs1 = getResults(sSQL1) rs2 = getResults(sSQL2) rs1 and rs2 and
I've got this code in a pair of button click event handlers on a
I've got this code here: SqlCommand CodeStatus = new SqlCommand(SQL, DB); DB.Open(); Reader =
How can I fetch images from a server? I've got this bit of code
I got this doubt while writing some code. Is 'bool' a basic datatype defined
I was given this code a while back. I finally got around to testing
I've got a problem with inheritance and generics. This is the code that illustrates
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
I've got some code that looks like this: using (DBDataContext dc = new DBDataContext(ConnectionString))
I've got HTML code that roughly looks like this: <li id=someid-11> <img src=... alt=alt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.