XCode 4 - Array Of Buttons
I'm trying to learn the Mac OS and iOs developing with XCod开发者_如何学JAVAe 4. My first application is a game for mac: Reversi (Othello).
I built my interface with a 8x8 grid of green buttons but now i don't understand how to link them in my AppDelegate class. How should i define an array of IBOutlet? I can't create 64 different attributes :D I read that iPhone developers can useIBOutletCollection
but i can't find a way to use it in my mac application...On the Mac, you can simply use one NSMatrix
outlet. Create a single button in Interface Builder, then select "Embed in > Matrix" from the "Editor" menu. When you resize the matrix while holding the option (alt) key, it will create a grid of multiple buttons instead of resizing the button itself.
精彩评论