This question follows on from a previous question. However stackoverflow presents me from commenting - like it sometimes prevents me from setting a correct answer on my own question.
Anyway I have some weirdness happening in my application. I have a property:
@property (nonatomic, retain) NSMutableArray *hotelList; //I also synthesize it
This is how I am setting the property:
- (void)populateHotelList
{
SearchWebServiceController *searchWS = [[SearchWebServiceController alloc]init];
//If I remove this retain the App crashes
hotelList = [[searchWS getHotelsByRegionCode:@"12345" AndByKid:@"12345"] retain];
[searchWS release];
}
However if I remove the retain my application crashes. But according to Apple documentation I should NOT need to retain it?!
This is the method's implementation:
- (NSMutableArray *)getHotelsByRegionCode:(NSString *)regionCode
AndByKid:(NSString *)Kid
{
NSMutableArray *result = [[NSMutableArray alloc]init];
...
return [result autorelease];
}
Can anyone please help!