title: iPhone custom delegate problem
body: <p>I have set up a delegate for my class 'HotRequest', but am having problems implementing it. The code for my class is below. Any ideas? Thanks</p>
  
  <p><strong>HotRequest.h</strong></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @protocol HotRequestDelegate;
  
  @interface HotRequest : NSObject {
      NSString *requestString;
      id &lt;HotRequestDelegate&gt; delegate;
  }
  
  @property (nonatomic, retain) NSString *requestString;
  @property (nonatomic, assign) id &lt;HotRequestDelegate&gt; delegate;
  
  - (id)initWithRequestOptions:(NSDictionary*)dict;
  
  @end
  
  @protocol HotRequestDelegate &lt;NSObject&gt;
  @required
  - (void)requestComplete;
  @end
  </code></pre>
  
  <p><strong>HotRequest.m</strong></p>
  
  <pre><code>#import "HotRequest.h"
  
  @implementation HotRequest
  
  @synthesize requestString, delegate;
  
  - (id)initWithRequestOptions:(NSDictionary*)dict {
      if ((self = [super init])) {
          for (NSString *key in [dict allKeys]) {
              requestString = [NSString stringWithFormat:@"%@&amp;%@=%@", requestString, key, [dict objectForKey:key]];
          }
          NSLog(@"%@", requestString);
      }
      [delegate requestComplete];
      return self;
  }
  
  @end
  </code></pre>
  
  <p><strong>WelcomeViewController.h</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "HotRequest.h"
  
  @interface WelcomeViewController : UIViewController &lt;HotRequestDelegate&gt;{
       HotRequest *myRequest;
  }
  
  @property (nonatomic,retain) HotRequest *myRequest;
  
  @end
  </code></pre>
  
  <p><strong>WelcomeViewController.m</strong></p>
  
  <pre><code>#import "WelcomeViewController.h"
  #import "HotRequest.h"
  
  @implementation WelcomeViewController
  @synthesize myRequest;
  - (void)viewDidLoad {
      [super viewDidLoad];
      NSDictionary *mydict = [[NSDictionary alloc] initWithObjectsAndKeys:@"2", @"1", @"4", @"3", nil];
      myRequest = [[HotRequest alloc] initWithRequestOptions:mydict];
      [[self myRequest] setDelegate:self];
  }
  
  - (void)requestComplete {
      NSLog(@"request complete");
  }
  @end
  </code></pre>