I have a NSString variable – it has a text – apple in one of my methods – viewDidLoad.
The same variable’s text becomes
<UIButtonContent: 0x4f8a190 Title = (null), Image = <UIImage: 0x4f5da60>, Background = (null), TitleColor = UIDeviceWhiteColorSpace 1 1, ShadowColor = UIDeviceWhiteColorSpace 0 0.5>
in another method which is executed after the first method. Why is the content getting lost?
The code
merchant = [retrieveBusinessData businessName]
[retrieveBusinessData businessName] returns a nsstring variable.
merchant = [[NSString alloc]initWithFormat:@"%@", [retrieveBusinessData businessName]];
This is the solution which solved my problem. I have posted in prince’s reply
retain NSString variable as NSString is an immutable class