I have one array that has many name in self.this is my code :
NSMutableArray *array = [[NSMutableArray alloc]initWithObjects:@"figo",@"messi",@"totti",@"ronaldo",@"pirlo", nil];
I want append this names in one TextView that any name to be in one line... but when run this app at last I see last name is in UITextView and another names was remove!!! please guide me about it.
this is my complete code :
ViewController.h
@interface ViewController : UIViewController
{
IBOutlet UITextView *text;
}
@property(nonatomic,strong) IBOutlet UITextView *text;
@end
ViewController.m
@implementation ViewController
@synthesize text;
- (void)viewDidLoad
{
NSMutableArray *array = [[NSMutableArray alloc]initWithObjects:@"figo",@"messi",@"totti",@"ronaldo",@"pirlo", nil];
[super viewDidLoad];
for (int i=0; i < [array count]; i++) {
NSString *a = [array objectAtIndex:i];
NSLog(@"%@",a);
[text setText:a];
}
}
@end
I want this name append in UITextView and these names to be in one line....like this:
figo
messi
totti
ronaldo
pirlo