I get a warning "Instance method '-objectFromJSONData' not found (return type defaults to 'id')

829 views
Skip to first unread message

trevor jordet

unread,
Mar 1, 2012, 4:59:48 PM3/1/12
to soundc...@googlegroups.com
when I make a request for soundCloud data, this line: NSDictionary *userInfo = [data objectFromJSONData]; generates the warning...

I dont know if it's possible, but if there is a way to clear that warning, it would be cool.

anyone have any suggestions?

Tobias Kräntzer

unread,
Mar 2, 2012, 3:58:53 AM3/2/12
to soundc...@googlegroups.com
Can you post the warning?

Cheers,
Tobias

--
Tobias Kräntzer
iOS Team, SoundCloud

> --
> You received this message because you are subscribed to the Google Groups "SoundCloudAPI" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/soundcloudapi/-/nNCFF_RtxN4J.
> To post to this group, send email to soundc...@googlegroups.com.
> To unsubscribe from this group, send email to soundcloudap...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/soundcloudapi?hl=en.

trevor jordet

unread,
Mar 2, 2012, 9:50:17 AM3/2/12
to soundc...@googlegroups.com
"Instance method '-objectFromJSONData' not found (return type defaults to id)

trevor jordet

unread,
Mar 2, 2012, 10:33:18 AM3/2/12
to soundc...@googlegroups.com
My app compiles fine, but the little yellow warning flag is there in Xcode.  I like to be rid of those little nagging reminders that there "might be something wrong with your code" :-p

Tobias Kräntzer

unread,
Mar 2, 2012, 12:28:07 PM3/2/12
to soundc...@googlegroups.com
Maybe you have to import the header or add the folder of the header to the header search path of your project. For questions/problems like this I suggest <http://stackoverflow.com>.

Cheers,
Tobias.

--
Tobias Kräntzer
iOS Team, SoundCloud

Am 02.03.2012 um 16:33 schrieb trevor jordet:

> My app compiles fine, but the little yellow warning flag is there in Xcode. I like to be rid of those little nagging reminders that there "might be something wrong with your code" :-p
>

> --
> You received this message because you are subscribed to the Google Groups "SoundCloudAPI" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/soundcloudapi/-/4BSps4A8iEgJ.

trevor jordet

unread,
Mar 2, 2012, 12:38:19 PM3/2/12
to soundc...@googlegroups.com
ha ha I use stackoverflow all the time. I just couldnt find the answer
to this one and thought someone here might have dealt with this and
have a quick fix.

trevor jordet

unread,
Mar 2, 2012, 4:10:33 PM3/2/12
to soundc...@googlegroups.com
the answer is:

When you make a custom class or use a class built outside of apple, you need to import the headers for the framework or class you are using. This allows the compiler to cross check return types and so forth.

When you attempt to send valid messages (but the compiler is unaware of) you will get that warning. The code should run and work with the warning there, but I am glad you want to get rid of the warning.

in the same .m file as the code you posted... near the top... add

#import "JSONKit.h"
Reply all
Reply to author
Forward
0 new messages