NSMutableArray: count is a method or a property?

Posted by Rafael Oliveira on Stack Overflow See other posts from Stack Overflow or by Rafael Oliveira
Published on 2010-03-26T13:39:02Z Indexed on 2010/03/26 13:43 UTC
Read the original article Hit count: 266

I want to verify if I'm in the last cell of the UITable. Should I use a NSInteger property in my controller and store the value of the count of the data (it's an NSMutableArray) that populates the table?

I'm asking because I don't know if count iterates over all objects of the array to count or if it only gets me a value of a count property.

What would be better ?

store the value: myCount = [myArray count] use directly: [myArray count] store numberOfRows: myCount = numberOfRowsInSection:[indexPath 0] use numberOfRows directly: numberOfRowsInSection:[indexPath 0]

© Stack Overflow or respective owner

Related posts about nsmutablearray

Related posts about iphone