Thanks for the response, but, still not working.

Here's in more detail what I'm trying to do. My main window is controlled by 
MyAppDelegate:

@interface MyAppDelegate : NSObject <NSApplicationDelegate> 


In MyAppDelegate I respond to an IBAction to open a second window to generate 
some data that needs to be go back to MyAppDelegate to put in my model. The 
second window is controlled by MyDataWindowController, a subclass of 
NSWindowController.  

- (IBAction)showDataWindow:(id)sender
{
    MyDataWindowController *searchDataWindow  = [[MyDataWindowController alloc]
                                      initWithWindowNibName: 
@"searchDataWindow"];
    [NSApp beginSheet:[searchDataWindow window]
           modalForWindow:[self window]
            modalDelegate: self
           didEndSelector: nil
              contextInfo: NULL];
}

This all goes fine, the sheet opens and I get generate the data, stored in an 
NSDictionary in MyDataWindowController. Now I  want somehow to get the data 
back to MyAppDelegate. So I am trying this in MyDataWindowController:

At the top of MyDataWindowController I add this @protocol:

@protocol MyDataWindowControllerDelegate <NSObject>
- (void)insertData: (NSMutableDictionary *)data;
@end

and then after the data is obtained:

        id <MyDataWindowControllerDelegate> del = [self delegate];      //      
<-------
        
        if ([del respondsToSelector:@selector(insertData:)])
        {
            [del insertData: data]; 
        }
    }
      
    [NSApp endSheet: [self window] returnCode: 1];
    [[self window] orderOut: self];

Which now gives the warning:

Semantic Issue: Instance method '-delegate' not found (return type defaults to 
'id') on the line with the arrow.



Any suggestions how to make this work?  Maybe not use a delegate?


Thanks,

- Koen.






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to