Redefinition with a different type

后端 未结 3 1597
无人及你
无人及你 2020-12-19 19:38

I\'m having trouble with this block of code:

        for (int i = 0; i < [tempInviteeArray count]; i++)
    {
        NSArray *tempContact = [tempInviteeA         


        
相关标签:
3条回答
  • 2020-12-19 19:51

    You already declared a variable in this scope named tempContact (NSArray *tempContact...). Change the name of one of them.

    0 讨论(0)
  • 2020-12-19 19:51

    try this

    for (int i = 0; i < [tempInviteeArray count]; i++)
    {
    NSArray *tempContact = [tempInviteeArray objectAtIndex:i];
    NSDictionary *tempContactDictionary = [tempContact objectAtIndex:1];
    int tempContactDelay = [[tempContact objectAtIndex:2] intValue];
      {
    
     FlokContact *tempContact = [[FlokContact alloc] initWithJSONData:tempContactDictionary andDelay:tempContactDelay];
    
      }
    
    }
    
    0 讨论(0)
  • 2020-12-19 20:01

    NSArray *tempContact and FlokContact *tempContact have the same name, that's the problem.

    Change FlokContact *tempContact to FlokContact *temp_Contact or what you want.

    0 讨论(0)
提交回复
热议问题