May 27, 2011

iOS4.2 Bug with UINavigationViewController

Everytime when I left the top view, I set the topView's title to @"TOP";
When I came back to the TOP, I would set the topView's title to @"", for that I had a backgroud image to be displayed as the title.
The problem was, with iOS4.2,the second time I left TOP view controller and went to a second level view controller, the back item in the NavigationBar disappeared.
"DISAPPEARED"!!!!!!!!!有木有!!!!!!!!!
I couldn't go back to the TOP!!!!!!!!!!!!!!
I got rejected by GREE for this f**king problem!!!!!!!

But, there's always a but!
I love but(this statement is still true by replacing the t with a double t)!

I came out with a solution.

1. set the top's title to @"TOP", don't set it back to @"";
2. every time you go back to the top , do this:
self.navigationItem.titleView = [[UIView alloc] initWithFrame:CGRectMake(0,0,1,1)];

Now, the problem disappeard!!!!
"DISAPPEARED"!!!!!!!!!有木有!!!!!!!!!

May 25, 2011

Weird problem with CCSprite

I added a CCSprite(with an image) as the background, the fps jumped to 30.0.
when I remove it or change the scale to less than 1.0, the fps would return to 60.0.
Now I am going to find out what's going on here.