今回は、IteratorパターンのCocoaでの実例を取り上げる。Iteratorパターンは、多くのプログラマにとって馴染みの深いものだろう。Cocoaでも、大変よく使われるIteratorパターンのクラスがある。NSEnumeratorだ。 NSEnumeratorのメソッド Iteratorパターンを使う上で重要な ...
Objective-Cによるデザインパターンの探訪。ここまでで、生成に関するパターン、構造に関するパターンを掘り下げてきた。今回からは、いよいよ振る舞いに関するパターンに入っていく。Ccooaでは、このパターンに分類される構造が数多く出てくるだろう。
I have an input stream that consists of floats. I have a std::vector< std::vector<float> >, because the data is really several columns of numbers, each of which I want to keep seperate. I'm trying to ...
I'm trying to use an iterator of a vector of pointers to objects of a class I've written, to proceed through each object in the vector and call a member function of that object. It's not working. I ...