1

Xcode is giving me error of "No known class method for selector 'sharedInstance'" for this code:

// access audio object
OALSimpleAudio *audio = [OALSimpleAudio sharedInstance];
// play sound effect
[audio playEffect:@"Hello.mp3"];

How to fix this error?

2 Answers2

1

In a very early release of Cocos2D v3 the header search paths were incorrect. Can you check that "Build Settings" -> "Header Search Paths" contains this search path:

"Source/libs/cocos2d-iphone/external/ObjectAL"

enter image description here

Ben-G
  • 4,996
  • 27
  • 33
0

I had the same problem. If this is still unresolved, in my case I had my own (different) version of a SynthesizeSingleton.h file in the project which was not compatible with the OALSimpleAudio code. Removing this additional SynthesizeSingleton.h file fixed this issue.