I guess I did not do an entry last night although I thought I did. Sorry about that. I did do work yesterday and should have made an entry. Anyway, I will discuss briefly what I did yesterday in one entry and go on to today's stuff in another entry. Yesterday I started chapter 21 on collection classes. This is very informative as these types of classes are used all the time. It discussed the NSArray, NSMutableArray, NSSet/NSMutableSet and I ended before I got to NSDictionary/NSMutableDictionary. The chapter kind of confirmed what I thought all along. There is a much bigger need for mutable objects than their immutable counterparts. So, for efficiency, they should have had an NSArray and an NSImmutableArray. But what do I know?
In any event, I did learn some cool new things. For example, NSSortDescriptor when passed to an mutable array via the sortUsingDescriptors method will sort the array according to one or more sort keys. If the array is storing class objects then the keys that are passed can be instance variables in the class instance or returned method data. Cool.
The NSPredicate is also very cool as it allows you to filter the array down to certain elements. You just add he predicate to the filteredArrayUsingPredicate method and boom, you have a subset.
Lastly, the NSSet/NSMutableSet provided a fast way to set up a collection where order does not matter. I assume this is probably good for large data sets.
No comments:
Post a Comment