I cant wrap my head around this for some reason...
I have a class (Model) with an ivar (value). I want to pass the value to a method and change the value ivar to point to something else. This changes the aValue to point to newString. So, how do I get the model.value to point to newString with out saying model.value = newString
?
(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
Model * model = [[Model alloc] init];//model.value gets set in init
[self doSomething:model.value];
NSLog(@"changed? %@", model.value);
}
- (void)doSomething:(NSString *)aValue
{
NSString * newString = [[NSString alloc] initWithString:@"new string"];
aValue = newString;
NSLog(@"changed? %@", aValue);
}
Also, how do I get this darn code block to work right?