I have an iPhone app in which I am trying to load two arrays in the same table. Create arrays and another array. And load it from that array. It's working fine. My problem is that I need to create different cell pictures for these two array objects. And the extension text label `
NSMutableArray * data more = [[NSMutableArray alloc] Init]; NSMutableArray * dataArray1 = [[NSMUTABELARROL] INST]; NSDictionary * News = [dict objectForKey: @ "news"]; NSDictionary * deals = [dict objectForKey: @ "deals"]; NSLog (@ "% @", [News Class Foracode]); NSLog (@ "% @", News); For (nucleusin * key in the news) {if ([key iskindoff class: [nsato class]]) {[dataraid object: key]; }} For (deals in NSDrive * key) {if ([key isKindOfClass: [NSDictionary class]]) {[dataArray1 addObject: key]; }} Self.newsarray = [[DataArrayBazeingAbjectFramArray: DataArere1] MuteCopy]; //self.newssarray=dataArray; [Self. MTableView reload data]; `I need to change the image of the cell for array elements with two arrays. If the element is already done then the cell image is the second one? Can anyone show me the code to get the snippet?
I will create a property and set its value to [dataArray count] . cellForRowAtIndexPath just do something like: if (indexPath.row & lt; dataArraySize) {// current line connection Is an element from the first array} else {// seconds array} You have to reset the data size size , if you update your data source If the size changes. / P> Alternatively, if you just want to display the data, then you do not really need to create a new composite array.
if (indexPath.row <[data count]) // // populate the row with the first array} and {// second array} < / Div>
Comments
Post a Comment