Help with a question of scope


My base window in my iOS app is a subclass of Juce UIViewComponent. In the constructor for this window, I create an audio filter (ala standalone filter window), and I also use setView() to set my custom UIView on the main window.

My window's (subclass of UIViewComponent) h file:

/* iosWindow.h */

ViewTest2 *viewTest; //this is my custom UIView

ScopedPointer<BasePluginAudioProcessor> filter;

My custom UIView also has a property for a pointer to my audioprocessor. In the main window mm file they get created like this:

/* constructor */

viewTest = [[ViewTest2 alloc]initWithFrame:CGRectMake(0, 0, getWidth(), getHeight())];
//get audio going
createFilter(); //this assigns my audioprocessor to the filter object (scoped pointer)

viewTest.filter = filter;

My problem is whenever I try to access a property of my filter, via the UIView, it says that filter is null and crashes.

Am I goofing up the scope or anything else anyone can see?