ios - Parse data from json local file using AFNetworking -
is possible parse data local json file ,using afnetworking instead of sbjson?
you don't need use afnetworking local json. won't have network related advantage in local files.
nsstring *filepath = [[nsbundle mainbundle] pathforresource:jsonfilename oftype:@"json"]; nsdata *jsondata = [nsdata datawithcontentsoffile:filepath options:nsdatareadingmappedifsafe error:nil]; nsdictionary *jsonobject = [nsjsonserialization jsonobjectwithdata:jsondata options:nsjsonreadingmutablecontainers error:nil];
now use jsondictionary
per need.
Comments
Post a Comment