I have been trying to find a solution to this everywhere but am stumped. Also, I am quite new to Xcode programming so I am struggling in parts where tutorials have not taught me.
Basically I have code from and xml file populating a table view.
<Teams>
<Team>Awesome Team Name</Team>
<Goals>24</Goals>
<Team>Rubbish Team Name</Team>
<Goals></Goals>
</Teams>
For the numberOfRowsInSection I currently have
return [appDelegate.teams count];
However, what I would like is to count the number teams where the players attribute is not null. Because of the way the xml is stored the teams with goals will always be at the top, so this way teams without goals are excluded from the table.
Its seems like it should be a simple solution, but I am struggling somewhat
I don’t know the structure of your teams array, but you can do something like this to get the count, assuming you can figure out how to access the players attribute.
Then teamsCount should be the count of all teams without null players.