Its seems you are fetching data from web-service maybe if so some of the value are coming as null
. Always try to cast your response and it value according to the expected value
you can set some macro method in define header file like that or you can define near interface declaration
//formula formation
#define NULLVALUE(m) ((m == nil || m==[NSNull null]) ? @"" : m)
#define NULLVALUESpace(m) ((m == nil || m==[NSNull null]) ? @" " : m)
#define NULLVALUEflaot(m) ((m == nil || m==[NSNull null]) ? 0.0f : (float)m)
#define NULLVALUEcolor(m) ((m == nil || m==[NSNull null]) ? @"ffffff" : m)
#define NULLVALUEOut(m) ((m == nil || [m length]==0) ? @"" : m)
#define NULLArray(m) ((m == nil || m==null) ? new NSArray : m)
#define SET_IF_NOT_NULL(TARGET, VAL) if(VAL != [NSNull null]) { TARGET = VAL; }
and then you can use it in anywhere in you code
like
[NSString stringWithFormat:@"%@", NULLVALUESpace([Response objectForKey:key])];