referencing outlet in another class?

Discussion in 'iPhone/iPad Programming' started by liptonlover, Jan 14, 2009.

  1. macrumors 6502a

    Joined:
    Mar 13, 2008
    #1
    If you helped me with my last problem, this code is related.
    I have two classes, one with a method to handle an 'operation', another that will be calling that method. Here's the method,
    Code:
    - (void)sendVariable:(float)variable toOutlet:(id)outlet {
    	[outlet setText:[NSString stringWithFormat:@"%f", variable]];
    }
    And here's the reference to it in another class.
    Code:
    [outletController sendVariable:test toOutlet:portalBuildings];
    Just so you know, test is a float set to 5 and it's declared in the same class as the above line is called. outletController is an IBOutlet pointing at an instance of the class with the method. I wasn't surprised by the following error, but don't know how to fix it/how to do what I want correctly.
    Code:
    error: 'portalBuildings' undeclared (first use in this function)
    Any help would be appreciated.
    Thanks, Nate
     

Share This Page