Second object of each pair must be non-nil

后端 未结 3 845
轮回少年
轮回少年 2021-01-21 12:17

Iam working on app and when i debug my code it is showing the following error.

-(IBAction)addSelected:(id)sender
{

    NSString* emptyStr = @\"\";

    NSDictio         


        
3条回答
  •  醉梦人生
    2021-01-21 12:43

    In my case i was doing this:

    NSDate *today = [NSDate date];
        NSTimeInterval currentTime = [today timeIntervalSince1970];
    
        NSMutableDictionary *dictExpiryDate =
        [NSMutableDictionary dictionaryWithObjectsAndKeys:currentTime, KEY_4_VALUE_OF_EXPIRY_DATE, nil];
    

    The problem here is currentTime, i replaced currentTime as followed:

    [NSNumber numberWithDouble:currentTime]
    

    This solved my issues.

提交回复
热议问题