Hey guys I'm trying to make a cocoa application that has a GUI that shows a drop down menu and a button called "Launch", the user chooses a game from the list and clicks "Launch", once they do that the application launches ([[NSWorkspace sharedWorkspace] launchApplication;, or something like that) I just started cocoa programming and really hope you can help me with this problem I'm having.
main.m
untitled.h
I get the error "dropDown undeclared (first use in this function)
Download the XCODE (3.0) Project:http://deathlyinvasionclan.com/jmacsoft/files/XG-Emulator.zip
main.m
Code:
//
// main.m
// XG-Emulator
//
// Created by JDogg on 22/12/07.
// Copyright __MyCompanyName__ 2007. All rights reserved.
//
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
NSString *chosenGame = [dropDown selectedItem];
[[NSWorkspace sharedWorkspace] launchApplication:chosenGame];
}
Code:
#import <Cocoa/Cocoa.h>
@interface dropDown : NSObject
{
NSString *chosenGame = [dropDown selectedItem];
[[NSWorkspace sharedWorkspace] launchApplication:chosenGame];
}
@end
Download the XCODE (3.0) Project:http://deathlyinvasionclan.com/jmacsoft/files/XG-Emulator.zip