I have a very basic question. I'm a new iPhone programmer. My question is can anybody tell me how can I pass values by reference to a function in obj. C? I know how to do it in VB and C#. But don't know how to do it in Obj c.
Thanks
I have a very basic question. I'm a new iPhone programmer. My question is can anybody tell me how can I pass values by reference to a function in obj. C? I know how to do it in VB and C#. But don't know how to do it in Obj c.
Thanks
There's an argument to be had if you want to get more than one address from a resulting function call. You can do so instead by creating a wrapper class and passing that instead. For example:
@interface AddressWrapper : NSObject {
NSArray *array;
NSString *string;
}
@property (nonatomic, assign) NSArray *array;
@property (nonatomic, assign) NSString *string;
@end
In *.m:
@implementation AddressWrapper
@synthesize array, string;
@end
-(void) getAddresses: (AddressWrapper*) wrapper {
wrapper.array = myNSArray;
wrapper.string = myNSString;
}