Hi, i've a stupid questiona about passing pointer.
I've this:
@interface MyClass : NSObject
myobj* foo;
-(void)doSomething:(myobj*)aObj;
@end
@implementation MyClass
-(void)doSomething:(myobj*)aObj
{
cFuncCall(&aObj); //alloc memory and init the object
}
-(id)init
{
//init stuff...
[self doSomething:foo]; // foo retun 0x0!!!
}
@end
why foo return nil??? It should be initialized by cFuncCall! [update]
Yes the problem is that foo is not changin outside doSomething. I've tried with myobj** but foo is still nil... This is the real code:
I declare FMOD::DSP *lowpassDSP;
in the class interface. No property is set.
This is the function that sould init lowpassDSP.
-(void)configFilter:(FMOD::DSP**)dsp
{
system->createDSPByType(FMOD_DSP_TYPE_LOWPASS, dsp);
baseChannel->addDSP(*dsp, 0);
}
and this is the call:
[self configFilter:&lowpassDSP];
in configFilter the dsp variable is correctly initiated but lowpassDSP is nil after calling configFilter.