Basically what i am trying to do is make a network refresh and fetch objects, store it in a nsmutable array in my app delegate. Then i have a listviewController which uses that mutable array to display data.
Setting nsarray is not working here is the code:
//Appdelegate code called after pulldown to refresh is done on listview:
[ListView setArrayElements:(NSMutableArray*)sortedArray ];
NSLog(@"sortedArray count:%d",sortedArray);
NSLog(@"ListView Array count:%d",[ListView.ArrayElements count]);
Result i get in log : "sortedArray count:12" (which is perfect)&"ListView Array count:0" (this is not the right result)
It’s hard to assume without seeing more of your code but how do you define the
ArrayElementsproperty? It may not be retaining itself and you may not have initialized it when theListViewobject is created.Let me know if this works;
Make sure
ArrayElementsis created in yourListView.hlike the following:Or on
-initor-viewDidLoadof yourListView,Don’t forget to release what you retained: