Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redefinition with a different type

Tags:

ios

I'm having trouble with this block of code:

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


    }

That last line throws an error:

 "Redefinition of 'tempContact' with a different type

initWithJSONData: accepts NSDictionary andDelay: int

I've tried to rewrite this code, with different types and all, I'm just not sure what I'm doing

like image 480
khaliq Avatar asked May 02 '26 06:05

khaliq


1 Answers

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

like image 62
MByD Avatar answered May 03 '26 21:05

MByD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!