How to fix a No visible @interface for NSString declares the selector JSONValue error

StackOverflow https://stackoverflow.com/questions/13364985

  •  29-11-2021
  •  | 
  •  

Вопрос

I have encountered this error:

No visible @interface for 'NSString' declares the selector 'JSONValue'.

The error occurs on:

NSDictionary * root = [responseString JSONValue]; NSArray *data = [root objectForKey:@"data"];

does anyone know how to fix it? Could I be missing a JSON file?

enter image description here

Это было полезно?

Решение

Add this line to the top of your .m file, where you try to call it:

#import "NSString+SBJSON.h"

Другие советы

Install the NSString+JSON category.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top