Re: Access object from another view

2010-09-21 Thread Steve Wetzel
I thought I had tried putting the setText statement after the addSubView but I went back and tried it again and it worked. Thanks for the suggestion. I cannot simply use IB to put the same label text in as the text label is calculated from user input. Thanks! Steve On Sep 21, 2010,

Re: Access object from another view

2010-09-21 Thread mmalc Crawford
On Sep 21, 2010, at 2:49 pm, Steve Wetzel wrote: > Then [self.view addSubView:viewController2.view]; brings up the subview. > You should [almost certainly] not be doing this. If you want to display another view controller's view, you should use an appropriate technique to present the view contr

Re: Access object from another view

2010-09-21 Thread Quincey Morris
On Sep 21, 2010, at 14:03, Steve Wetzel wrote: > I could not get the > > [self.viewController1.label2.text > > or the > > [self view addSubview:viewController2.view]; > > to work for some reason. Then it dawned on me that I could set the value > right before I added the Subview! > > [vie

Re: Access object from another view

2010-09-21 Thread Steve Wetzel
I think that is what I did with the line [viewController2.label2 setText:label1.text]; Then [self.view addSubView:viewController2.view]; brings up the subview. The only problem is that the text in label two is not displayed correctly until I release and reload the view. I have a button to rem

Re: Access object from another view

2010-09-21 Thread Steve Wetzel
Thanks Everyone. I could not get the [self.viewController1.label2.text or the [self view addSubview:viewController2.view]; to work for some reason. Then it dawned on me that I could set the value right before I added the Subview! [viewController2.label2 setText:label1.text]; [self.view a

Re: Access object from another view

2010-09-21 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 9/21/10 11:57 AM, Steve Wetzel wrote: > How do I access and object on one view from another view? I cannot > figure it out. > > I have two view controllers and two views. Lets call them > viewController1 and viewController2 and view1 and view2. >

Re: Access object from another view

2010-09-21 Thread Steve Wetzel
I hope I am replying correctly, I am new at this. The text in label1 is set with the setText method when the view is loaded. What I am trying to achieve is putting some text whose value is in a label on view1 into a label on view2 (called label2). I was hoping to do with with something like…

Re: Access object from another view

2010-09-21 Thread Quincey Morris
On Sep 21, 2010, at 11:57, Steve Wetzel wrote: > How do I access and object on one view from another view? I cannot figure it > out. > > I have two view controllers and two views. Lets call them viewController1 > and viewController2 and view1 and view2. ViewController1 loads the second > vi

Access object from another view

2010-09-21 Thread Steve Wetzel
How do I access and object on one view from another view? I cannot figure it out. I have two view controllers and two views. Lets call them viewController1 and viewController2 and view1 and view2. ViewController1 loads the second view by: [self.view addSubview:viewController2.view]; There i