iPhone – UIWindow rotating depending on current orientation?

You need to roll your own for UIWindow. Listen for UIApplicationDidChangeStatusBarFrameNotification notifications, and then set the the transform when the status bar changes. You can read the current orientation from -[UIApplication statusBarOrientation], and calculate the transform like this: #define DegreesToRadians(degrees) (degrees * M_PI / 180) – (CGAffineTransform)transformForOrientation:(UIInterfaceOrientation)orientation { switch (orientation) { case UIInterfaceOrientationLandscapeLeft: return CGAffineTransformMakeRotation(-DegreesToRadians(90)); … Read more

Convert a UIView origin point to its Window coordinate system

It sounds like your not converting between the proper views. A view’s frame is set to the coordinates of it’s superview, not its own internal coordinates, so if you were trying to convert the origin of a view to window coordinates, you would need to use the superview: [[self superview] convertPoint:self.frame.origin toView:theWindow]; However, it is … Read more

iOS – Get location of a view in a window?

Use can use the UIView method covertRect:toView to convert to the new co-ordinate space. I did something very similar: // Convert the co-ordinates of the view into the window co-ordinate space CGRect newFrame = [self convertRect:self.bounds toView:nil]; // Add this view to the main window [self.window addSubview:self]; self.frame = newFrame; In my example, self is … Read more

What is the difference between UIApplication.sharedApplication.delegate.window and UIApplication.sharedApplication.keyWindow?

For most uses, they will be the same… but not always. [UIApplication sharedApplication].keyWindow is the window which is currently being displayed on the device. This is normally your application’s window, but could be a system window. [UIApplication sharedApplication].delegate.window is the window your application is expected to use. Which one should be used? Well that all … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)