Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Legolover64

macrumors regular
Original poster
Feb 24, 2008
149
0
Hi all!

The value property in my parent view controller's property is a float, and I'm using the @property (readwrite, assign) specifier. I'm synthesizing the properties. Here's what I was just playing with:

Code:
((myViewController*)self.parentViewController).otherViewController.value = 1.0; 

assert(((myViewController*)self.parentViewController).otherViewController.value == 1.0);

This assert statement fails. I'm really confused why it's happening. Any ideas? The property is a float.

Thanks so much for any and all help!
 
Either parentViewController or otherViewController is nil. I'd log them both to find out which, and then go find out why they weren't set.
 
xsmasher,

Turns out both of those values are nil. I looked up the documentation for parentViewController, and it's only not nil if I'm using a navigationController or something similar. Sadly I can't see to be able to write to the view controller which contains my current view controller (parentViewController is readonly).

Is there some other way to access the view controller in which this view controller is rendered?

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.