0

Okay, I have an Book Object Class. That has Book.name and Book.id as extensions. Book.name being NSString. Which is what should be searchable and listed in UITableView.

NSMutableArray *matchingSymptomsArray = [[NSMutableArray alloc] initWithCapacity:50];

for(NSMutableArray *letterArray in DataArray){
        for(Book *bk in letterArray){ //Heres the ERROR
            NSLog(@"Uptil NEW");
            if([bk matchesSearchString:searchString]){
                        //I couldnt reach here, according to debugging and Logs//
                [matchingSymptomsArray addObject:bk];
            }
        }
    }

DataArray is where all the Books are held.. more than a hundred. Its the main datasource for the UITableView. I'm trying to search and match each letter of the string with the Book.name, but even before I can begin, I cant do the for(Book *bk in LetterArray) //producing the error..

What seems to be the problem?

This is the error in console **** -[Book countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x55c110 2009-09-29 06:17:41.073 Smart Diagnosis[3897:20b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[Book countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x55c110'

Any work arounds??

thanks for your help :)

2 Answers 2

1

Try this:

for (id bk in letterArray) { }

Did you check that letterArray isnt nil or empty?

Sign up to request clarification or add additional context in comments.

Comments

0

Did you check that letterArray isnt nil or empty?

1 Comment

hmm, thats funny.. Its crashing if I'm calling for letterArray.count! for(NSMutableArray *letterArray in DataArray){ NSLog(@"dataarray = %d letterArray = %d", DataArray.count, letterArray.count); //It stops here.. DataArray is filled up fine, with 195 value. But When I add letterarray.count to it, it stops with the same error!. Im so confused!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.