I know some C++ and now I will try to learn Objective-C as well. My book mentioned class methods briefly and said that class methods are messages that can be sent to a class, often it is used to create an instance of the class.
Does this mean that class methods are kind of like constructors in C++? In my case, I have a card game with a Deck class (currently in C++). When I create an instance of it, I do this:
Deck deckWithCards(52); // A deck with 52 cards with values
Deck deckWithoutCards; // An empty deck
If I was to do the same thing in Objective-C, is it considered good "style" to do it like this:
Deck *deckWithCards = [Deck newDeck:52]; // A deck with 52 cards with values
Deck *deckWithoutCards = [Deck newDeck]; // An empty deck
Have I understood class methods correctly? Are there other uses for class methods?