views:

953

answers:

4

Used the MyGizmoClass example in a iPhone app where I have an object that sets and maintain db info.

How do I eliminate the 'MyGizmoClass' may not respond to '+sharedManager'

Warning

The offending line of code is: NSString *databasePath = [[MyGizmoClass sharedManager]databasePath];

A: 

You need to import the MyGizmoClass.h file into your implementation. This lets the compiler know all the MyGizomoClass methods and will prevent the warning.

If this is already the case, then sharedManager isn't properly defined in the MyGizmoClass interface (.h file).

August
MyGizmoClass.h is imported in implementation file (and in it's header (just to see if that would stop the warning)).
Steve Gibson
A: 

Not sure if this belonged in a comment or as and answer.

MyGizmoClass.h is imported in implementation file (and in it's header (just to see if that would stop the warning)). But the warning is still happening.

Steve Gibson
You'll have to post code, then.
August
+1  A: 

It sounds like the +sharedManager method is not declared in the header. You've mentioned importing the header a couple of times but haven't said whether +sharedManager is part of that header. The error you're seeing indicates that either (a) the header's not being imported (and you've said that it is) or (b) the header is being imported but doesn't contain the method in question.

Tom Harrington
A: 

DOH!.... thanks for the kick in the #&&. I forgot that particular method in the header and it was staring me in the face all day.

Steve Gibson