I've done this thing lots and lots of time. But I don't know why I can't figure out what is the issue with this object when I try to fetch it from NSDictionary.
I've NSMutableArray object which have below data.
( { SelectUserDataResult = "[{ 'UserID': '3D5CC4E6-25E8-4591-A84A-6BD7D020DB17', 'ClientID': '895D7BE5-B5D0-48AE-8AAB-6863FCD1D5BF', 'TimeZoneCulture_Term': 'en-US', 'Currency_Term': 'GBP', 'LoginLogID': 'c76960b1-aa24-454f-9fe7-f4f3960fefd4' }]"; } )
Now I fetch my first object like
NSDictionary *dicResponse = [[[NSDictionary alloc]initWithDictionary:(NSDictionary *)[data objectAtIndex:0]] objectForKey:@"SelectUserDataResult"];
NSLog(@"%@",dicResponse);
[{ 'UserID': '3D5CC4E6-25E8-4591-A84A-6BD7D020DB17', 'ClientID': '895D7BE5-B5D0-48AE-8AAB-6863FCD1D5BF', 'TimeZoneCulture_Term': 'en-US', 'Currency_Term': 'GBP', 'LoginLogID': 'c76960b1-aa24-454f-9fe7-f4f3960fefd4' }]
Now, from above I want fetch UserID and other things so, I just code like
NSString *abc = [dicResponse objectForKey:@"UserID"];
but it gives me error like
-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x7a70200
Can't find where I'm wrong.
Thanks
========= Part-2
I just mange to change my NSMutableArray object data as below
( "[{ 'UserID': '3D5CC4E6-25E8-4591-A84A-6BD7D020DB17', 'ClientID': '895D7BE5-B5D0-48AE-8AAB-6863FCD1D5BF', 'TimeZoneCulture_Term': 'en-US', 'Currency_Term': 'GBP', 'LoginLogID': 'c76960b1-aa24-454f-9fe7-f4f3960fefd4' }]" )
NSDictionary *dicResponse = (NSDictionary *)[data objectAtIndex:0];
gives me the same thing as last.
how to remove " as mikeweller suggest.