Challenge

Re-open your project from the Chapter 21 challenge.

No one other than you (the creator of the BNRPortfolio class) needs to know that you are using an NSMutableArray to hold the BNRStockHolding instances.

Move the property declaration for the array into a class extension in BNRPortfolio.m and add methods to BNRPortfolio to allow the addition and removal of stock holdings.

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.