Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
I think this really boils down to not understanding why matchups is returning an "undeclared identifier" error in my ButtonViewController when it's declared and synthesized in XMLParser .h and .m, which is then imported into ButtonViewController.

There is one appearance of matchups in the posted code for ButtonViewController:
Code:
    filteredArray = [self.matchups filteredArrayUsingPredicate:pred];
It's commented out as posted.

The reason it's an undeclared identifier is that self in that statement refers to a ButtonViewController, not an XMLParser. The method it's in belongs to ButtonViewController. A ButtonViewController object contains an XMLParser object, but that doesn't mean it is one.

Analogy -- a Car has wheels. A Car contains Persons. A Person has legs. If you refer to someCar.wheels, you get the number of wheels the car itself has. If you refer to someCar.legs, it's nonsense because a Car has no legs, even though any Persons in the car do have legs.

I think you should go back and review fundamental concepts.
 
What resources have you been using to "learn French from a book", as it were? That is, how have you been educating yourself on the fundamentals of Objective-C / iOS programming?

This book.

You do? Good. Explain it to me then. Pretend I know less about Objective-C than you.

The [xmlParser matchups] is returning the array after running it through the parser, whereas self.matchups is a way to access properties within and can only be called with its existing class (which I, of course, wasn't doing).

It was working? Is it no longer working? Or are you no longer using it? If so, why did you change it?

As I've stated, the parser returned results for the entire season and I wanted to display them one round at a time. The full array used the count function to load the appropriate number of buttons. This worked, but was not what I ultimately wanted. I wanted the filteredArray to act in the same way.

I got it to work by using filterUsingPredicate to filter my existing NSMutableArray matchups rather than create a new array, and by moving the code back to XMLParser.m instead of trying to run it in ButtonViewController.m as a global property.

Final code:
Code:
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"round == %@", roundSelected];
    [self.matchups filterUsingPredicate:pred];


----------

There is one appearance of matchups in the posted code for ButtonViewController:
Code:
    filteredArray = [self.matchups filteredArrayUsingPredicate:pred];
It's commented out as posted.

Yeah that was the state when I posted it, but it wasn't commented out when I was trying to run it.

The reason it's an undeclared identifier is that self in that statement refers to a ButtonViewController, not an XMLParser. The method it's in belongs to ButtonViewController. A ButtonViewController object contains an XMLParser object, but that doesn't mean it is one.

Analogy -- a Car has wheels. A Car contains Persons. A Person has legs. If you refer to someCar.wheels, you get the number of wheels the car itself has. If you refer to someCar.legs, it's nonsense because a Car has no legs, even though any Persons in the car do have legs.

I think you should go back and review fundamental concepts.

Agreed.

I finally got it to work, mostly by stopping to think, rather than "plug and play." Thanks for your help.
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.