This I could handle:
myArray = [[NSMutableArray alloc] init];
[myArray addObject:@"some1"];
[myArray addObject:@"some2"];
I manage to transfer a basic NSMutableArray from AppDelegate.m to ‘anotherClass’.m, Im using it in a tableView, but now I need to go one step further =)
What if my array looks like this
mySecoundArray =[NSMutableArray arrayWithObects: sak1,sak2,nil];
Where
BombDoc *sak1 = [[BombDoc alloc] initWithTitle@"Title1" weight:10 otherField:@"Special" ];
As I mentions above I would like to use the mySecoundArray in my tableView, the problem is that I do not know how to pick out sak1:s first info, the Title, so I can use it as the name of the TableCell.
I would be glad if anyone out there can give me a hint, better of, an explicit line of code.
If I understood your question correctly, your problem is that you don’t know how to access the data members(properties) of the item in the array?
You can get the object in the array by casting it to the right type:
Hope this answers your question.
Best regards, Rat
EDIT:
You might also suffer from an empty array after you’ve passed the
mySecoundArrayto the table view.As you see, you are using 2 different ways for initializing your
NSMutableArray:You might want to get a non-auto-released instance instead:
You must remember that using this approach requires you to release
mySecoundArraymanually.