Drawing to a Window or View
Drawing to an NSOpenGLView Class: A Tutorial
Though I had done according to the guide, MyOpenGLView was not added to the main window.
I fixed this problem by
(1) Click "Show Documents Outline" button in the left bottom in MainMenu.xib pane.
(2) Then "Objects" pane is shown. I moved MyOpenGLView object under the window's view.
(I wanted to use addSubview method, but couldn't find the window's view.)
The result is project op1.
Drawing OpenGL Content to a Custom View
The explanation of the guide is insufficient and old. I changed and added codes according to "General Approach"
in the top of this page.
The result is project op2_2. (op2 was failed to addSubview and couldn't fix it.)