使用其他类型重新定义

kha*_*liq 3 ios

我遇到了这段代码的问题:

        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];


    }
Run Code Online (Sandbox Code Playgroud)

最后一行抛出一个错误:

 "Redefinition of 'tempContact' with a different type
Run Code Online (Sandbox Code Playgroud)

initWithJSONData:接受NSDictionary和Delay:int

我试图重写这个代码,不同的类型和所有,我只是不知道我在做什么

MBy*_*ByD 7

您已在此范围内声明了一个名为tempContact(NSArray *tempContact...)的变量.更改其中一个的名称.