Reputation: 2200
identifierListController.nameArray = [[NSMutableArray alloc] initWithArray:nameArrayT copyItems:YES];
namearray is array of view controllers. I am reading values from webserver and putting into nameArrayT and then from nameArrayT to nameArray of the 2nd view which I select from the array.
I have tried:
identifierListController.nameArray = [[NSMutableArray alloc]initWithArray:nameArrayT copyItems:YES];
identifierListController.nameArray = [NSMutableArray arrayWithArray:nameArrayT];
[identifierListController.nameArray addObject:soapResults1];
[identifierListController.nameArray addObjectsFromArray:nameArrayT];
and all is not working for me, as when i am trying to display values of array by using NSLog()
its shows null
.
Do I have to create an NSString object and then copy that to the array? I hope some one knows how to do this.
Thanks :)
Upvotes: 1
Views: 2512
Reputation: 2592
i hope you have made propery for name array and synthesized it as well,then you just need to do this.
@property(nonatomic,retain)NSMutableArray *nameArray;
and alloc this whether in LoadView,ViewDidLoad as you require.
[identifierListController.nameArray addObjectsFromArray:nameArrayT];
Or use this
NSMutableArray *nameArrayResult= [identifierListController.nameArray addObjectsFromArray:nameArrayT];
Now you can access array contents from nameArrayResult.
This will help you Good luck
Upvotes: 1
Reputation: 5380
Try first to allocate the array and then to copy objects:
identifierListController.nameArray = [NSMutableArray new];
[identifierListController.nameArray addObjectsFromArray:nameArrayT];
Upvotes: 4