• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
obj-c newb question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: obj-c newb question
      • From: Chris Hanson <email@hidden>
    • Re: obj-c newb question
      • From: "Mike R. Manzano" <email@hidden>
  • Prev by Date: exclude windows from exposé
  • Next by Date: Re: Freeform forms
  • Previous by thread: exclude windows from exposé
  • Next by thread: Re: obj-c newb question
  • Index(es):
    • Date
    • Thread