iphone - How to "reset" to the starting view? -


i have first sample iphone application - version of tictactoe. it's working fine 1 time %) cant figured out how reset view in game starting position.

i followed formic game example "iphone cool projects" book. create controller, view , mark x or o signs in game via uiimageview add subview view. that's ok , works fine. want remove x , o's , start new game - , cant understand how clear screen. btw game example book didn't have resetgame method :(

i tried release view think wrong - clear screen got memory errors later , cant initialize board again. tried call viewdidload - nothing. best practice this?

thx!

to clear xs , os uiimageviews, send them -[uiview removefromsuperview] message. remove them superview , visible ui. if not retained object removed memory well.

you use release memory management tool. never use remove visible elements ui or other functional task.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -