I’m trying to create a class which contains different method, each one of these methods will perform some http requests operations and return a result to the caller method.
for example:
UserOperations *op = [[UserOperations alloc] init];
int age = [op getUserAge];
the method "getUserAge" will call a web service and do some xml parsing to return a value (the age) to the caller.
what’s the best and right way to implement it.
thanks
You need to implement
delegatepattern here.See
Protocols and delegatesin iOS. Please visit here and Apple documentationAnd, also see a similar question asked on SO here