1

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:

  1. identifierListController.nameArray = [[NSMutableArray alloc]initWithArray:nameArrayT copyItems:YES];

  2. identifierListController.nameArray = [NSMutableArray arrayWithArray:nameArrayT];

  3. [identifierListController.nameArray addObject:soapResults1];

  4. [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 :)

4
  • are you able to print your original array (nameArrayT)?? Feb 22, 2011 at 10:32
  • What is the property doing? Have you synthesized getter/setter methods for it? Did you implement them yourself? If so, what does the methods look like?
    – user457812
    Feb 22, 2011 at 10:35
  • @lukya "NSLog(@"nameArray : %@",nameArrayT);" values are not there, but something like following coming : nameArrayT : ( "Automatic CSG selection in E-UTRA with CSG list on USIM, success", "Automatic CSG selection in E-UTRA with CSG list on USIM, success", "Automatic CSG selection in E-UTRA with CSG list on USIM, success", "Automatic CSG selection in E-UTRA with CSG list on USIM, success"
    – Pooja
    Feb 22, 2011 at 10:51
  • have u checked identifierListController is correctly allocated ? Feb 22, 2011 at 11:12

2 Answers 2

4

Try first to allocate the array and then to copy objects:

identifierListController.nameArray = [NSMutableArray new];
[identifierListController.nameArray addObjectsFromArray:nameArrayT];
0
1

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.