Hi Luke,
I'm getting closer to finish my project. However, I still have one more problem.
I add an text field to my custom dialog, called it naTextField and set the naTextField Outlet to connect to the text field to my custom dialog.
Then I create my .h and .m for for class. Inside that class I also create an method called getActTextFieldString that will return the "text field "value:
@implementation NAActDlg
- (NSString *) getActTextFieldString
{
return [naTextField stringValue];
}
@end
Here is the header:
@interface NAActDlg : NSObject
{
IBOutlet NSTextField *naTextField;
}
- (NSString *) getActTextFieldString;
@end
Then when try to display the getActTextFieldString return value inside method shouldExitPane I always get a bad string.
- (BOOL)shouldExitPane:(InstallerSectionDirection)dir
{
NAActDlg *clipView = [NAActDlg alloc]; //Initialize ClipView
//NSRunAlertPanel([[[self section] installerState] targetVolumePath], @"MSG", nil, nil, nil);
NSRunAlertPanel([clipView getActTextFieldString], @"***MSG*", nil, nil, nil);
return YES;
}
Are I doing something wrong ? I need to pass getActTextFieldString to an other function that will use the return string.
Michel Cunha
On 10-May-06, at 6:18 PM, Luke Bellandi wrote:
Hi Michael,On May 10, 2006, at 1:26 PM, Michel Cunha wrote:
Thanks, it did work :)
An other question:
Can I mix C/C++ code with Cocoa ? Can I write an C++ function and called it inside - (BOOL)shouldExitPane:(InstallerSectionDirection)dir ?
Yes you can. The short of it is that Objective-C++ files need to have a ".mm" extension (compared with Objective-C's ".m" extension) -- the specifics are covered in this document:
- Luke