uiwindow

why is UIWindow a child and also a parent of UView?

The UIKit reference says UIView is a superclass of UIWindow, but despite of this parentage, a UIWindow actually manages UIViews. This sounds so unusual to me. Does anyone know what the significants of this are in terms of software design? Many thanks. EDIT: I read the related paragraph in the iPhone programming guide. Yet I couldn't s...

Logical error or is my program skipping parts?

FYI I'm programming in objective-C but anyone might be able to help. I've been sitting here for the past two hours trying to figure out what the problem is and I've done everything I know to debug this simple little coding problem. Check out the code below and I will explain. In the application, it starts out with MainScreenViewControlle...

UIWindow and UIView addSubview Question

Does the addSubview method actually load the view into the application or not? The reason I am asking is because I have two two views in my application. The application delegate adds the two views as subviews and then brings one of the views up front. Now, I have a print statement in each of the viewDidLoad methods for each view. When I ...

iPhone Dev - UIToolbar goes in window or view?

Should I put the UIToolbar right in the window at the bottom, and then put the view above it (so the view doesn't continue underneath the toolbar), or should I just make the view cover the whole window and then add the toolbar as a subview to the view? So my question is, should the toolbar be a subview of the view or the window? - the w...

How to get touch coordinates REGARDLESS of what "view" I may have touched?

In my ViewController, I have a UITableView with some custom cells in it. When I touch a cell I want to get the touch coordinates right there into my UIViewController. The problem is, I can only get coordinates from parts of the screen not occupied by the UITableView..., Whenever my touch falls in the parts of the screen with the UITableV...

“Normal” UIButton causing obj_stack_overflow or EXC_BAD_ACCESS exception

It sure looks innocuous enough. In my App Delegate, I check NSUserDefaults for a flag to show tips at startup. If it’s set then, at the end of applicationDidFinishLaunching:, I do this: TipsViewController *vc = [[TipsViewController alloc] initWithNibName:@“TipsView" bundle:nil]; [window addSubview:vc.view]; [vc release]; The idea is...

iPhone - Get Position of UIView within entire UIWindow

The position of a UIView can obviously be determined by view.center or view.frame etc. but this only returns the position of the UIView in relation to it's immediate superview. I need to determine the position of the UIView in the entire 320x480 co-ordinate system. For example, if the UIView is in a UITableViewCell it's position within ...

makeKeyAndVisible & makeKeyWindow - uiwindow in iphone

In every application, there is always written as [window makeKeyAndVisible]; What is mean by makeKey? ...

Problem of screen not being refreshed in cocos2d layer, screen, navigation controller's view sequnce

I have a added a navigation controller's view in application's main window using, [window addSubview:[navController view]]; I have also one push notification, NSNotificationCenter *theNotificationCenter = [NSNotificationCenter defaultCenter]; [theNotificationCenter addObserver:self selector:@selector(showSelf:) name:@"showHomeMenu" o...

Adding a UIWindow in xcode iPhone SDK

Hi there. I am creating a project in which i have to change the main.m file, so that UIApplication doesnt appear straight away, so i deleted the following line from main.m int retVal = UIApplicationMain(argc, argv, nil, nil); and deleted these lines from AppDelegate - (void)applicationDidFinishLaunching:(UIApplication *)application ...

How can I change the color of a UIWindow from a separate class?

I am trying to change the background color of a UIWindow when an action is sent to the class MyController. However the UIWindow resides in the AppDelegate class so I don't have access to the variable to modify it using window.backgroundColor = [UIColor theColor]; in MyController. Here is the code for MyController.m: @implementation M...

subclassing MainWindow with UIWindow but NSSet *touches = 0?

I am subclassing MainWindow with UIWindow and in that using hit test method: -(UIView *)hitTestCGPoint)point withEventUIEvent *)event { UIView *hitView = [super hitTestoint withEvent:event]; if (hitView == self) return [[self subviews] lastObject]; else if([hitView isDescendantOfView:myView]) { NSSet *to...

UIWindows or UIViews

I need three different sections in my app: a login screen, a main screen, and one that takes place in landscape mode, all totally different. I saw Apple insists that an app should have one window, so I'm asking: what would be best to use for this? Three big windows, or views? And how should the hierarchy look like? I don't have experienc...

PLEASE HELP unknown error [UIWindow endDisablingInterfaceAutorotation] ?

I am receiving this error. I have no clue as to why it would be called, and google didn't really help, any suggestions? -[UIWindow endDisablingInterfaceAutorotation] called on <UIWindow: 0x4e0ec50; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x4e0f9e0>> without matching -beginDisablingInterfaceAutorotation...

How do I detect touches on UIStatusBar/iPhone

I'm trying to detect any touch on the iPhone's UIStatusBar but its not working. I've tried subclassing UIApplication and UIWindow to access it but still nothing ...

How does the overall view hierarchy change when using UIKit view manipulations?

I've been trying to figure out what happens in the view hierarchy when methods like pushViewController:animated, presentModalViewController:animated, and tab switches in UITabBarViewController are used, as well as UIAlertView and UIActionSheet. (Side note: I'm doing this because I need to know whether a specific UIView of my creation is...

iPhone basic sheet programming?

Hi, I want to program an "Add"-Window to my application, much like the "Add Contact"-window in the Contacts app or the "Add City"-window in the Weather app. My question is: how do I code the effect of sliding up that Contacts & Weather feature? -- Ry ...

Orientation in a UIView added to a UIWindow

OK, bear with me. I have a UIView which is supposed to cover the whole device (UIWindow) to support an image zoom in/out effect I'm doing using core animation where a user taps a button on a UITableViewCell and I zoom the associated image. The zooming is performing flawlessly, what I haven't been able to figure out is why the subview i...

Shake Gesture detection in UIWindow subclass

I setup a UIWindow subclass as detailed in an answer from this post: http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone/1351486#1351486 I am running into an issue where only the methods motionBegan: and motionCancelled: will fire. I need to detect the motionEnded: method, and whatever I do it simply ...

How can I pass a UIEvent to a UIScrollView

I am subclassing UIWindow and creating an implementation of sendEvent: as follows: - (void)sendEvent:(UIEvent *)event { [super sendEvent:event]; // Send event to UIScrollView here } How can I send the event to a UIScrollView. I tried calling the touchesBegan:, etc. messages, but that did not do anything. ...