uiviewcontroller

UIView class

hi all in my application two view is there its name is Loginview and sampleview this Loginview i added to [self.view addsubview:Loginview]; after login action. i changed self.view as [self.view addsubview:sampleview]; but that time also loginview is showing.. to avoid this. how to remove sub view in self.view pls help me ... ...

Can I retain a View while releasing its ViewController?

I'm trying to load a new view into an existing view controller, but I want to load that view from a xib file. My plan was to create a second viewController (viewController1 in the code below), then retain its view and release that viewController that I just created. I was hoping that the viewController would be released and the view woul...

Flipping Subviews above a main view

Hi all - I'm trying to build a subview that sits above my main view that is approximately 3/4 the size of the main view. When a button is pressed, the subview should flip to another subview. I'm close, but am having TWO problems. The first problem is that the first time the flip button is pressed, the second subview starts at full s...

problem with reload data from table view after come back from another view

I have a problem in my application. Any help will be greatly appreciated. Basically it is from view A to view B, and then come back from view B. In the view A, it has dynamic data loaded in from the database, and display on the table view. In this page, it also has the edit button, not on the navigation bar. When user tabs the edit b...

How do I shared an object between UIViewControllers on iPhone?

My application is a tab bar application, with a separate view controller for each tab. I have an object in my first view controller (A) which contains all my stored application data (Please ignore NSUserDefaults for this) which needs to be accessed by the second view controller (B) when I press a button on it. How can I achieve this cou...

Class variable type gets changed

So in my view controller, I run code to populate an NSArray of Customer (custom class) objects. This custom class has objects that are of ANOTHER custom class called Address (a customer has a billing address and a shipping address). In the view controller when a customer in the list is selected, it passes a new view controller a customer...

Fitting Cocoa Animation into MVC/OOP patterns

MVC/OOP design patterns say you don't set a property, per se, you ask an object to set its property. Similarly, in Cocoa you don't tell an object when to draw itself. Your object's code has detailed HOW it will draw itself so we trust the frameworks to decide when (for the most part) it should draw. But, when it comes to animation in C...

Does moving a view to new superview automatically release it from old superview?

It's not clear, to me anyway, if a UIView is automatically released from its superview if you use addSubview to add it to another view?!? I know a view can only have ONE superview but I'm not clear about how, exactly, to go about moving a subview from one superview to another. retain view, release (from old superview), addSubview to new...

passing handles between a ViewController and a View

I have an array of booleans (soundArray) that is modified based on user input. Therefore it is owned by the main UIView that the user is interacting with. Meanwhile, in another separate controller (GestureController), I need access to this soundArray, so I can pass it as a parameter in a method call. I'm pretty sure a ViewControlle...

Is it wise to "nest" UIViewControllers inside other UIViewControllers like you would UIViews?

I've got a fairly complex view, for me anyway, that has a few "trays" with custom interface items on them. They slide in and out of my root view. I'd like to nest (addSubview) the items inside the view. Each needs some setup before being displayed...and none can be configured in IB (they're subclasses of UIView). I'm wondering if it ma...

How to reload a uiviewcontroller on the iPhone

Hi, I'm trying to reload a value I set on UIViewController to update each time I transition with this code (coming and going are both UIViewControllers): coming.phoneNumber = aPhoneNumber; [coming viewWillAppear:YES]; [going viewWillDisappear:YES]; [going.view removeFromSuperview]; [self.window insertSubview: coming.view atIndex...

UIView vs UIViewController

Ok so i am realllly new to the iphone development and i've gotten pretty far for my knowledge. I just need help deciding how to program these 4-6 pictures into my project. I basically want to make a comic book with the user being able to swipe from one picture to another. Should all these picture be in UIVIEW or UIViewController? and...

UIViewController remove from superview after receiving nsnotification

Hello, i'm trying to remove a UIViewController from the superview after receiving a notification but it doesn't work. in my appDelegate i do something like this: - (void)applicationDidFinishLaunching:(UIApplication *)application{ NSLog(@"applicationDidFinishLaunching"); [window addSubview:tabBar.view]; splash = [[SplashViewControll...

dismissModalViewControllerAnimated nonatomic?

I have a weird timing issue, it seems. I open a uiimagepicker as a modal view. When the user picks an image or I want to take the image, save it to a variable, then open an email interface as a modalview. My problem is that I am calling dismissModalViewController on the imagepicker, then calling presentmodalviewcontroller for my email...

Moved my viewController under a NavController and now awakeFromNib and initWithCoder don't fire?!?

I have a somewhat complex view that I put together in a separate (View-based template) project (the View Controller was represented with orange icon in MainWindow.xib). It's far enough along now that I've decided to move it into another project where it will be managed by a Navigation Controller. It is called from UINavigationController'...

How to set subview of UIView dynamically (iPhone)?

Hi, I am surely doing something completely stupid here, hopefully someone can tell me what! In summary I would like to programmatically toggle a subview when a button (I'll use a segmented button) is clicked. It need not animate. Ideally I'd load the contents of these views from a nib. I am pushing a UIViewController subclass, initiali...

Why is this over-releasing? UINavigationController / UITableview

I'm pushing a view controller onto my navigation controller's stack from within my TableViewController's didSelectRowAtIndexPath method as so: MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] de...

Cocoa Touch UIViewController Properties and class design

I'm creating a custom ViewController. This VC needs to load some data that is known in the event that creates it and pushes it to the top of the NavigationController that it is going to be part of. My question is, how should I pass data from the view that handles the custom ViewController's creation into that custom ViewController. ...

UIView and UIViewController practice for inheritance

Hi, I was just wondering if this approach looks like a good practice for apps with a lot of custom views, for nested PNG graphics and animations that may change based on user interaction. I created a BaseView class that extends UIView @interface BaseView : UIView { @protected BaseViewController *controller; } @property (retain...

Basic Objective-C: Why does this code work?

Question 1) I have a navigation based application where clicking on an entry opens a second view with the details of that entry. It's working now with the following code [self.navigationController pushViewController:descriptionController animated:YES]; [self.descriptionController.textView setText:[s description]]; self.descriptionC...