I'm trying to loop through an array (compare Addr), and find the matching Strings (currentAddr) and trying to put only the matvched Strings into another array but i keep getting an error
"No visible @Interface for NSArray declares the selector addObject"
NSArray *matchedAddr;
//NOTE: multiple addresses from compareAddr[i] may match to multiple stored Addresses
for (NSUInteger i = 0; i < [compareAddr count]; i++)
{
//Checking IF the obtained key (Mac Address) at compareAddr[i] matches one of the stored Addresses
NSString *currentAddr = [compareAddr objectAtIndex:i];
BOOL addrExists = ([[dictionaryOfAddresses objectForKey:@"StoredAddr"]objectForKey:currentAddr] != nil);
if (addrExists)
{
NSLog (@"Match found at index %1u", i);
[matchedAddr addObject:currentAddr];
}
else { NSLog(@"No Value matches at index %i \n", i); }
}
NSLog (@"Array of matched addresses for further processing %@", matchedAddr);
Define it as mutable
NSMutableArray *matchedAddr=[[NSMutableArray alloc]init];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With