iphone - why isn't my original variable changed when I pass by reference a CoreData managed Object variable? -



iphone - why isn't my original variable changed when I pass by reference a CoreData managed Object variable? -

why isn't original variable changed when pass reference coredata managed object variable?

so have in iphone application, coredata managed object called config. 1 of variables in xcode 4 produced *.h , *.m files "@dynamic height;" (i point out because wonder if it's related this). when accessing variable in code nsnumber.

so when setup new info selection view/controller set variable in controller equal height, when alter in next view & come back, should changed in 1st view (pass ref concept).

only problem doesn't seem alter value?

some code extracts:

@interface config : nsmanagedobject { @private } @property (nonatomic, retain) nsnumber * height; @end @implementation config @dynamic height; @end

calling 2nd view

// prepare selectorcontroller *sc = [[selectorcontroller alloc] initwithstyle:uitableviewstylegrouped]; sc.returnvalue = self.config.height; // show new window [self.navigationcontroller pushviewcontroller:sc animated:yes]; [sc release];

section controller

@interface selectorcontroller : uitableviewcontroller { nsnumber *_returnvalue; } @property (nonatomic, retain) nsnumber *returnvalue; @end

nsnumber immutable, is, can't alter value after it's created. when assign new value nsnumber property, it's different object , original object doesn't alter @ all.

iphone objective-c ios core-data pass-by-reference

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -