I'd use a NSDictionary to return multiple values from a method. In the dictionary each value is named and referenced by a key. The keys in this example are "ca" and "da" and the values are both a short string of text.
-(NSDictionary *) abc: (NSInteger) weeks year:(NSInteger) year {
NSString* ca = [NSString stringWithFormat:@"Week is %d", weeks];
NSString* da = [NSString stringWithFormat:@"Year is %d", year];
return [[NSDictionary alloc] initWithObjectsAndKeys:ca, @"ca", da, @"da", nil];
}
Call the method and pick out the returned values with code like this:
NSInteger weekParam = @"52".integerValue;
NSInteger yearParam = @"2011".integerValue;
NSDictionary *result = [self abc:weekParam year:yearParam];
NSLog(@"ca has value: %@", [result objectForKey:@"ca"]);
NSLog(@"da has value: %@", [result objectForKey:@"da"]);
You log should have the following lines added:
ca has value: Week is 52
da has value: Year is 2011