obj-c newb question
obj-c newb question
- Subject: obj-c newb question
- From: Michael Stevenson <email@hidden>
- Date: Tue, 4 Nov 2003 18:40:21 -0600
New to obj-c, and just trying to throw together something stupid to
make sure that my understanding is correct.
Xcode keeps telling me that my object "may not respond to" one of my
methods. Anyone help me out? Thanks
ahead of time...
declaration:
@interface doop : NSObject {
AudioDeviceID deviceID;
OSStatus status;
UInt32 DataSize;
}
-(AudioDeviceID)GetDefaultDevice;
-(char*)GetDeviceName:(AudioDeviceID)device;
-(char*)GetManufacturerName:(AudioDeviceID)device;
@end
implementation (this is the method that it tells me may not "respond"):
@implementation doop
-(AudioDeviceID)GetDefaultDevice {
DataSize = sizeof(char*);
status =
AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
&DataSize, (void*)&deviceID);
#ifdef DBG
if (status)
printf("AudioHardwareGetProperty: Default Output Device: Status:
0x%d\n", (int)status);
#endif
return (status?(AudioDeviceID)-1:deviceID);
}//GetDefaultDevice
...
main:
int main() {
id DefaultDevice;
AudioDeviceID device;
DefaultDevice = [[doop alloc] init];
printf("defaultdevice: 0x%x\n", (int)DefaultDevice);
device = [doop GetDefaultDevice];
printf("device id: 0x%x\n", (int)device);
return 0;
}//main
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.