PDA

View Full Version : view not responding




liptonlover
Mar 7, 2009, 12:31 PM
This is a project I just started, all that happens so far is that a view programatically becomes the top subView of a window, and the view has two buttons on it. Both buttons are standard UIButtons, not messed with. One is linked to a method so that I can switch back to another view. But when I start the app, neither button responds. They don't 'depress' or anything. By commenting out certain lines of code, I found the two problematic ones. This code is in the ______AppDelegate.m file that comes with new projects, in the application did finish launching method, after the makeKeyAndVisible line.

CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2);
self.window.transform = transform;
CGRect contentRect = CGRectMake(0, 0, 480, 320);
self.window.bounds = contentRect;
I THINK understand what's going on, but I did not write this code. I grabbed it off the internet because I was having no luck getting the same results. This does what I want, except for the problem. The 3rd and 4th lines are the ones that locked up the screen when used, I commented out the first two and it still worked, though the view didn't rotate.
Can anyone help?
Thanks in advance, Nate


Edit: After a little messing around, the problem seems to be the two zeros in the last line. The original code actually had a -80 and an 80, I changed that since it offset the view, but apparentely otherwise the touchevents are offset. But I can't find a solution anywhere. So.... any help will still be greatly appreciated :)
Nate