Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Data Merging
View Single Post
Old 04-05-2009, 11:46 AM   #2 (permalink)
Dollopp
Registered Member
 
Join Date: Apr 2009
Posts: 123
Default

Hi,

I am pretty inexperienced as well so I may be missing the crux of the problem but can you not just use the "addObjectsFromArray:" method to add the generated values to the plist data Array:

Code:
[plistDataArray addObjectsFromArray:generatedArray];
or add both sets to a new array:

Code:
NSMutableArray *newArray = [NSMutableArray arrayWithArray:plistDataArray];
[newArray addObjectsFromArray:generatedArray];
Or a third option which I think might be what you are looking for, to interleave the values from each array:

Code:
NSMutableArray *newArray;
NSInteger counter = 0;
GeneratedObject *tempObject;

for(PlistObject *currentPlistObject in plistDataArray) {
   [newArray addObject:currentPlistObject];
   tempObject = [generatedArray objectAtIndex:counter];
   [newArray addObject:tempObject];
   counter++;
}
I have not tested any of this but hopefully you get the general idea and it is what you are looking for.

M.J.
Dollopp is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,687
Threads: 89,160
Posts: 380,406
Top Poster: BrianSlick (7,110)
Welcome to our newest member, masterrr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:10 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.