[Solved] Unable to solve the error “[__NSCFBoolean length]: unrecognized selector sent to instance”


Your issue is with this line:

NSURL *U1 =[NSURL URLWithString:[dict objectForKey:@"img"]];

The problem is caused by the fact that you assume:

[dict objectForKey:@"img"]

is returning an NSString when in fact it is returning an NSNumber representing a boolean value.

You need to either figure out why the data in the dictionary is incorrect or you need to use the correct key to get the URL.

solved Unable to solve the error “[__NSCFBoolean length]: unrecognized selector sent to instance”