Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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, 10:46 AM   #2 (permalink)
Dollopp
New Member
 
Join Date: Apr 2009
Posts: 118
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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,296
Threads: 39,091
Posts: 171,393
Top Poster: smasher (2,575)
Welcome to our newest member, Issue
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:03 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.