I was reading document about ARC and came across a part which confused me.Please can anyone help me. I have two questions: 1.I know ARC release object when no variable is pointing to it.Now suppose I have some method say:(NSString *)returnString, whose return type is NSSTring;So what will happen to the variable which is declare in the method returnString?I know the receiving variable will get release when it comes out of scope of the method where returnString is called but what will happen to the variable which is inside returnString.
-(NSSTring *)returnString
{
NSString *str = //Some value;
return str;//What will happen to this.
}
and Other method:
-(void)useString
{
NSString *str1 = [self returnString]; //It will get release when this method gets over.
}
2.What will happen if returnString is in some third party library which isn’t compiled with ARC?