ios - data not coming for nsmutablearray -
i have nsmutablearray data below.
{ id = "57\n "; image = "http://www.mysite.com/32f7aff4-9cb2-4044-a555-bfac8ea6eace.gif\n "; nameen = "salim\n "; specializationsen = "dentistry\n "; }
now wanted imaage name hence tried
[[feeds objectatindex:0] objectforkey:@"image"]
but giving me error
-[__nsdictionaryi objectatindex:]: unrecognized selector sent instance 0x759b0b0 terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nsdictionaryi objectatindex:]: unrecognized selector sent instance 0x759b0b0'
any idea going wrong?
as far can tell data structure you've posted, don't have array object rather dictionary object , dictionary won't respond objectatindex:.
try replacing this:
[[feeds objectatindex:0] objectforkey:@"image"]
with this:
[feeds objectforkey:@"image"]
or, if prefer modern objective-c syntax, this:
feeds[@"image"];
Comments
Post a Comment