8) Had a breakthrough on this question tonight. Can't believe I completely forgot about
[UIApplication sharedApplication]. This returns the singleton application instance. Using this, you can create a class which implements the UIApplicationDelegate protocol and have access to all those
application* methods listed in the
original post.
This also allowed me to access the main UIWindow, which can be used to add other custom views like the ones I mentioned earlier (UITextField, UIButton, UISlider). For instance, this code will add a UITextField to the screen:
PHP Code:
UIApplication *application = [UIApplication sharedApplication];
UIWindow *window = [application.windows objectAtIndex:0];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(20, 20, 100, 20)];
[window addSubview:textField];
[textField release];
I am having one issue with this, however: any subview which is added using
[window addSubview:myView] is appearing in portrait mode instead of landscape (I imagine this will be fixed once question #2 is solved).
12) Another problem I am having sounds like it can be solved using the answer on
this question on Stack Overflow (or
this question, though the answer may trigger a bug according to the comments). Trouble is, I believe this is something that would have to be changed behind-the-scenes in the engine itself.
I will further elaborate on the issue I am having: I have a list of tabular data that be will drawn vertically down the screen. This data is being drawn inside of a Region instance so that you can scroll to the off-screen data. However, I would like to use the touch events from a UIScrollView to scroll through the data in the region, instead of having to use the scrollbars (which is unheard of on iOS devices).
At this point, everything appears to be working fine, except for the fact that while the UIScrollView is scrolling, the region doesn't update. As soon as it stops, it instantly jumps to the new position.