NSData dataWithContentsOfFile returning null

前端 未结 6 890
再見小時候
再見小時候 2021-02-19 11:19

I am trying to fetching a JSON file which exist in my xcode resources using this code

-(void)readJsonFiles
{
    NSString *str=[[[NSBu         


        
6条回答
  •  故里飘歌
    2021-02-19 12:00

    You need to use pathforResource with resourcetype and check if there is data in your file.

    That should not be nil.

提交回复
热议问题