Good Morning ,
I have been trying to make a dynamic message box on a UIAlertView but i havent been managing , im sending data from one class to another using the command :
message = @"Now Starting Download";
transition.message = self.message;
NSLog(@"%@",message);
Over here message shows @"Now Starting Download"
When i go over to the other class (transition class) , i implement using this code :
-(id) showmessage:(NSString *)trans
{
NSLog(@"%@ This is in the transition class",message);
return trans;
}
and message now is empty :@
Any help would be appreciated
-Chris
This:
makes no sense. First off, if you’re only using the class to NSLog an NSString*, why not just return an NSString*? Also, you want to NSLog the object passed in the method, because that’s all that matters here. Here’s my suggested edits:
If this doesn’t work, or prints null, then you are definitely not taking ownership, or suggesting a strong enough retain length, of the string you are passing to this method.
Or, to take a different approach, you imply that you want the class of the object coming through, which would be why you decided to return (id), in which case, you might try
or even add a sender argument to your method:
-(NSString*) showmessage:(NSString *)trans withSender:(id)sender;