I'm working on modifying an existing open source objective C program (CotVNC) and it has the following line:
NSBeginAlertSheet(header, okayButton, [server_ doYouSupport:CONNECT] ? reconnectButton : nil, nil, window, self, @selector(connectionTerminatedSheetDidEnd:returnCode:contextInfo, nil, nil, aReason);
The net result of which is, if you click ok, it calls connectionTerminatedSheetDidEnd with the default return code. This function then calls
[self connectionHasTerminated]
in the situation I'm using it, without doing anything else. I want to take out the sheet and have the function called directly, but for some reason, whilst with a button it works perfectly, replacing the NSBeginAlertSheet with simply
[self connectionHasTerminated]
or even calling connectionTerminatedSheetDidEnd with the appropriate arguments fails. So I assume that sheets must do something odd when they call a function. Do they perhaps spawn a new thread or something, or am I missing the point completely?
Thank you so much for any help!
Wrayal
NSBeginAlertSheet(header, okayButton, [server_ doYouSupport:CONNECT] ? reconnectButton : nil, nil, window, self, @selector(connectionTerminatedSheetDidEnd:returnCode:contextInfo, nil, nil, aReason);
The net result of which is, if you click ok, it calls connectionTerminatedSheetDidEnd with the default return code. This function then calls
[self connectionHasTerminated]
in the situation I'm using it, without doing anything else. I want to take out the sheet and have the function called directly, but for some reason, whilst with a button it works perfectly, replacing the NSBeginAlertSheet with simply
[self connectionHasTerminated]
or even calling connectionTerminatedSheetDidEnd with the appropriate arguments fails. So I assume that sheets must do something odd when they call a function. Do they perhaps spawn a new thread or something, or am I missing the point completely?
Thank you so much for any help!
Wrayal