Concatenating NSString inside of UITextView
Posted
by Jason
on Stack Overflow
See other posts from Stack Overflow
or by Jason
Published on 2010-06-12T21:30:09Z
Indexed on
2010/06/12
21:32 UTC
Read the original article
Hit count: 277
I'm some trouble adding strings together for a UITextView in my app. The method I've been using is this
(header)
#import <UIKit/UIKit.h>
@interface calculatorViewController : UIViewController {
IBOutlet UITextView *output;
}
-(IBAction)b1;
@property(nonatomic, copy) NSString *output;
@end
(main)
#import "calculatorViewController.h"
@implementation calculatorViewController
-(void)b1 {
[output stringByAppendingString:@"hi"];
}
The problem I've been having with this method is when I use the button the app crashes. The warning it gives me is 'UITextView' may not respond to '-stringByAppendingString:'
When I replace output with at string it works though and that confused me.
Any suggestions? Am I doing something wrong?
Thanks
© Stack Overflow or respective owner