Check if NSString is nil assign @“” value

NSString, NSMutableDictionary

NSString *str = (self.farm == nil ? @””:self.farm);

NSMutableDictionary *aDictionaryPhotoDataModel = [NSMutableDictionary new];

    [aDictionaryPhotoDataModel setObject:(self.farm == nil ? @””:self.farm) forKey:@”farm”];

Leave a comment