Given a view, how do I get its viewController?
I have a pointer to a view. How do I access its viewcontroller? "[self superview]" is another view, but not the viewcontroller, right? ...
I have a pointer to a view. How do I access its viewcontroller? "[self superview]" is another view, but not the viewcontroller, right? ...
I know that I'm either operating with a fundamental misunderstanding or have just missed something simple here. Basically I'm trying to add a new UIViewController on top of an existing UIViewController when the user clicks a UIButton. -(void)newCharacterClick:(id)sender{ characterViewController *viewController = [[[characterViewCont...
this is my inherited class of UIView : MobileView @interface MobileView : UIView { IconView *icon1; IconView *userCar; id goTimer; } @property (nonatomic, retain) IconView *icon1; @property (nonatomic, retain) IconView *userCar; -(void) goRightInSeconds: (NSInteger)secs; -(IconView *) cannon; @end I also have another cl...
When ran in activity monitor, the real memory usage for a program running the following piece of code will increase endlessly: CGRect frame = CGRectMake(0,0,0,0); while(true) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; UIView *test = [[UIView alloc] initWithFrame:frame]; [test release]; [pool release]; } What ...
I have created a simple UIView hierarchy in IB: Parent (UIView) child (UIView) child (UIView) child (UIButton) The button sits atop the two sibling UIViews. My app launches in landscape mode rather then portrait. When the only child view is a UIButton, the button correctly rotates 90 deg. However, when I add the child UIViews th...
Hi, I have a view with several subviews which in turn have several subviews. If I fire an event, say touches ended, in one of the bottom level views, how can I see what that event generating view was in the root view or second level view? Additionally any idea how to catch that event and then release the mid level view which would in t...
I am trying to get a button on a navigation bar to load a new view, simple right? I have been unable to get it to work here is my code - (IBAction)addAction:(id)sender { NSLog(@"Button pressed"); NSString *viewController = [[addViewController alloc] initWithNibName:@"AddView" bundle:nil]; self.addViewController = viewContro...
Hi Everyone: I am wondering how I can create an outer glow effect outside a UIView on the iPhone, kind of like when clicking a regular NSTextField on the Mac. Thanks for any help! ...
Hi all! I've just created a new view based application, and now I want to set the background color at the application startup rather then in IB. I have found this code in a tutorial: UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; [view setBackgroundColor:[UIColor greenColor]]; But my view is sti...
I have a UIViewController that contains a subview and a UIToolbar. I'm trying to add another UIViewController containing an MKMapView as a subview, but it is not resizing properly and as a result, the map is overlapping the toolbar. What am I doing wrong? - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil ...
I have saved a bunch of CGContextRefs and I want to draw all of these out in the drawRect portion of my UIView. How can I do this? ...
I have a beginner iPhone project going. I have a TableView, which is just a listbox with a bunch of entries and a small UiView on the bottom. See the pic. The problem is that the UiView essentially becomes part of the listbox and will only appear when I scroll down to the last item in the TableView. I'd like the UiView to be anchored...
I'm just beginning to try out development for the iPhone. My requirement is very similar to thar provided by a UISegmentedControl except I need custom buttons instead of those in a UISegmentedControl. Here's more detail: I need one view controller which loads the first view having 3 custom buttons on the top. Below the buttons, I need t...
I am working on iPhone app and I have an openGL view rendering on top of a regular UIView. It's working, but I can't seem to get the openGL view to have a transparent background that shows the UIView underneath. Instead, I get a big black box. I have tried setting the background color to UIColor clearColor, I've set opaque to NO, I've...
I have an opengl scene rendering on an EAGLView layer and some other elements (circles and such) rendering on a UIView (which is a sibling of the EAGLView, positioned above it). Is it possible to blend colors between the two layers? I'd like to do some difference blending to get an inversion effect on the colors from EAGLView. I've ...
hello how can i call in the current view, a method implemented in the viewcontroller of the current view's superview? can you help me please. thanx ...
I have a Custom view. This custom view has two UIImageViews - imageview1 and imageview2. [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:2.00]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)]; [UIView setAnimationTransition:UIV...
I have a UIView subclass (CustomView for purposes of this question) that has its own handling of all touches events (Began, Moved, Ended, Cancelled). I also have a UIButton that is a sibling of CustomView that overlaps it. For example, my view hierarchy looks like this: UIView (Controller's view) CustomView with frame (0, 0, 300, 300...
OK. Some New Query Here. Suppose user taps on a button & video begins to play. Now when video plays, it always in full screen mode. But what do i need is explained below. Video should be played in a portrait mode. (but normally video is played in landscape mode ). How? Thanks in advance for sharing your knowledge with SO... ...
I have an instance of UIScrollview containing an instance of UIView. The UIView is just a container for a horizonal array of UIImageView instances. - Zooming is provided by UIScrollView and UIScrollViewDelegate. I would like to constrain zooming to occur only along the horizontal axis with no vertical scalling at all. How to I do this? ...