I want to send a string from one class to the other:
1) In class1, I add a property to hold the string:
@property (nonatomic, retain) NSString *str;
2) and a method to send back a string:
-(NSString *)sendBackStr:(NSString *)strURL
{
NSString *str = [[NSString alloc] stringWithString:strURL];
return str;
}
3) In class2, I add a property to hold the received string:
@property (nonatomic, retain) NSString *returnStr;
4) and the following code:
Class1 *c1 = [[Class1 alloc] init];
returnStr = [c1 sendBackStr:@"URL"];
But the program stops at returnStr = [c1 sendBackStr:@"URL"]; Any ideas about what's wrong with it?