- (IBAction) changeProductText:(NSString *)str;{ lblProductTxt.text = str; }
I have that and i am trying to make it so that i can have the str and @"text" but i don't know how to bind them together.
Any thoughts?
I have that and i am trying to make it so that i can have the str and @"text" but i don't know how to bind them together.
Any thoughts?
Are you trying to append two strings? Use stringByAppendingString:
:
- (IBAction) changeProductText:(NSString *)str
{
// set label text to str followed by "text"
lblProductTxt.text = [str stringByAppendingString:@"text"];
}
I don't know if this is your issue, but the code you posted had an extra semi-colon. You have:
-(IBAction)changeProductText:(NSString *)str; //Problem is here
{
lblProductTxt.text = str;
}
It should be
-(IBAction)changeProductText:(NSString *)str
{
lblProductTxt.text = str;
}
You should try using the following code in your IBAction to know if str actually has a value:
NSLog(@"Value of String: %@", str)