NSString * strNil= [NSString stringWithFormat:@"%@",nil];
The result is strNil is @"null"
Well, I want it to be @""
And I want an elegant solution. I know I can just create emptyStringIfNil category method. But that wouldn't work because that function will return nil, instead of @"".
What do you do for this?
Basically I want statements like
NSString * result =[NSString stringWithFormat:@"http://%@/business/api/addOrEditBusiness.php?flag=%@&title=%@&building=%@&latitude=%@&longitude=%@&website=%@&street=%@&city=%@&country=%@%@&originalid=%@&inbuildingaddress=%@&email=%@&zip=%@%@&userid=%@%@",urlServer,strFlag,biz.Title.RobustURLEncodedString,biz.buildingName.RobustURLEncodedString,@(coord.latitude),@(coord.longitude),biz.Website.RobustURLEncodedString,biz.Street.RobustURLEncodedString, biz.City.Name.RobustURLEncodedString, biz.City.Country.Name.RobustURLEncodedString,strPhonesParameter,biz.ID.RobustURLEncodedString,biz.InBui
to show empty everytime the string is nil
For example, if streetAddress is nil, I want &street=&city=Tokyo instead &street=(null)&city=Tokyo