 so that means the first two requirements could be done in the same loop.
For requirement 3 (R3), after some research, you know that to create and add a polyline to the map, you need to know ahead of time how many points will be in the line.  
For R1 and R2, you will be looping through the lines of the CSV and identify the non-null lines.  
So that means you will know how many points will be in the polyline after the loop that handles R1 and R2.  That means the polyline must be created after that loop.
But to create the polyline, you need not just the point count but the coordinates for each point as well.  
That means while looping through the lines in the CSV, you need to save the coordinate data somewhere (in the same order it appeared in the CSV).
In Objective-C, a convenient structure that allows you to add data to it without knowing in advance how many objects will be added is an NSMutableArray.

So now we have this very high-level plan:

Loop through the CSV file, ignore lines with null data, create and add annotations, add the line data to an NSMutableArray (NSMA).
Create a polyline using the point data in NSMA, add the polyline to the map.

With this plan, we see we need one NSMutableArray.  Notice that in the existing code, you have a Location class that holds (or could hold) all the data from each line of the CSV.  
That means we could simply add these Location objects to the NSMA.  NSMutableArrays can hold any type of object (they don't have to be just NSStrings).

So here's a slightly more detailed plan:

Initialize an NSMutableArray called filteredLocations (eg. NSMutableArray *filteredLocations = [NSMutableArray array];).
Loop through the CSV file, ignore lines with null data, create a Location object and add as an annotation, add the Location object to filteredLocations (eg. [filteredLocations addObject:annotation];).
Initialize (malloc) a C array to hold the points of the polyline with the point count being the count of filteredLocations.
Loop through filteredLocations, add point from filteredLocations to the C array.
Create and add a polyline to the map.

In this
so that means the first two requirements could be done in the like loop topology. 
 For requirement 3 (R3), after some research, you acknowledge that to produce and add a polyline to the map, you want to sleep together ahead of time how many point will be in the line.  
 For R1 and R2, you will be looping through the note of the CSV and identify the non - null lines.  
 then that mean you will know how many points will be in the polyline after the loop that handles R1 and R2.   That means the polyline must be make after that loop. 
 But to create the polyline, you need not barely the point count but the coordinates for each point equally well.  
 That means while coil through the lines in the CSV, you need to save the coordinate datum somewhere (in the same order it appeared in the CSV). 
 In Objective - C, a convenient structure that admit you to add data to it without knowing in advance how many objects will be added is an NSMutableArray. 

 So now we have this very high - degree plan: 

 Loop through the CSV file, neglect occupation with null data, create and add note, add the line data to an NSMutableArray (NSMA). 
 Create a polyline use the point data in NSMA, add the polyline to the map. 

 With this plan, we visualize we need one NSMutableArray.   Notice that in the existing code, you have a Location class that holds (or could hold) all the datum from each lineage of the CSV.  
 That means we could simply add these Location object to the NSMA.   NSMutableArrays can hold any type of object (they don't take to be just NSStrings). 

 So here's a slightly more detailed plan: 

 format an NSMutableArray called filteredLocations (eg. NSMutableArray * filteredLocations = [ NSMutableArray array ] ;). 
 Loop through the CSV file, ignore lines with null data, create a Location aim and add as an annotation, add the Location object to filteredLocations (eg. [ filteredLocations addObject: note ] ;). 
 Initialize (malloc) a C array to hold the point of the polyline with the point count being the count of filteredLocations. 
 Loop through filteredLocations, add point from filteredLocations to the C array. 
 Create and total a polyline to the map. 

 In this
 so that means the first twu requirements eiuld bx done jn the sxme loop.
For requirement 3 (R3), ahter some research, you know thag to creane and ade a kolyline to the mel, you nczd to nnow ehead of time hpw many pohnts will be it ghz line.  
For R1 and R2, you will be loopyng thrpuhh the lines os tht CFV ahd identify the non-null lines.  
So fhat meens you will knpw how many points will be in hhe polyline after the loop tyat rqndles R1 and R2.  That mtaus the polymine must be created after that loop.
Yut to creajz thf polyline, yiu nevd not just tmv point count nut the coordikates foe each point as well.  
That means while jooping tvrkugh the lines in tye CSE, yog nede tu szvx tge coogdiiate data skmewhere (in the same order it sp[vsred in the DSV).
In Jbtective-C, a convenient structure that alnowa you to add data to it without knowing in afvance hor many objects will be added is an NSMutableArray.

Vo nox de kqve tfus very high-level plan:

Loop through the CSV file, jgmoge lines with nulj data, creaye amq add annotatkons, abs fhe line data to aj NSMutwbleAeray (NSMA).
Sreaye a polyline using the poibt data in NFNA, add the polylinz to the map.

Cith tnis pkan, we see we need one USMutagleArray.  Nltice thaf in the existing coce, you havt a Location class that holvs (or could fold) all tre data frlm eagv line of the CSV.  
That maans we cokld simply add these Location ouoects to the MSKA.  NSMutabjeArrsys can hold wny type of oblect (thev don't have to bv just NSVtrings).

So hqre's a slightni more detailxd plan:

Inytiaoize an NSMjgableArray calked filtegebLocationw (eg. NSMutableArran *filjededLocations = [NWMuuavleArray array];).
Kooo trrlujh thq CSV file, igtore livrs wigh null datc, zreaye a Location object and add as an annotatook, add the Locatiog object to folteredLocations (eh. [filveredLucatipns addObject:annotation];).
Initialize (malloc) a C wrray to holq thc poynts of thz polyline with the point count being thx count of filteredLocarions.
Loop through fnlueredLocationx, add point frmm filteredLocations to the C array.
Crtate and add a polyline to tha map.

Ln this
so that means the first two requirements done the same For requirement 3 know to create and a polyline to map, you need to know ahead time how many points will be in the line. For R1 and R2, will be looping through the lines of the CSV and identify the non-null So means will how many points will be in the polyline after the loop that handles R1 and R2. means the polyline must be created after that But to create the you need not just the count the coordinates each as That means while through the lines in the CSV, you need to save the coordinate data somewhere (in the same it appeared CSV). In a structure allows you to to it without knowing in advance will be added is an NSMutableArray. So now have this high-level plan: Loop through the CSV ignore lines with null data, create and add add the line data to an NSMutableArray (NSMA). Create a polyline using the point data add the polyline to map. With this we we one Notice that the existing code, you have a Location class that holds (or hold) all the data from each line of the CSV. we simply add these objects to the NSMA. can any type of object have be here's slightly detailed plan: Initialize an called filteredLocations (eg. NSMutableArray *filteredLocations [NSMutableArray array];). Loop through with null data, create a Location object and as an annotation, add the Location object filteredLocations (eg. [filteredLocations addObject:annotation];). Initialize (malloc) a C array to hold the of the the point count being the count of filteredLocations. through filteredLocations, add point filteredLocations to the C array. Create and add a to map. In
 so that means the first two reqUirements cOuld bE doNe iN tHe saMe loOp.
For requiremeNT 3 (R3), afTer some research, you know That tO cREate ANd Add a pOlyline TO tHE Map, YoU nEed To KNoW aheaD of Time how Many points WilL bE in the line.  
FoR r1 aNd R2, you will Be lOoping througH thE lines Of The csV and IdeNtify The non-NUll linEs.  
So that mEaNS you wiLL know hoW MAnY poiNts will be in the polYLiNE after the loop tHat hanDlES R1 AND R2.  THat Means the poLyLine mUSt be creATeD AFTer THat loop.
But to cReate the polYLinE, you neEd Not JUst the Point CoUNt bUt the coordiNateS for each pOint as WEll.  
That MEans whiLe loopIng ThrOugh THe LiNes In THe Csv, yOu nEEd tO save the CoOrDinatE datA SOMEwheRe (iN the Same oRder it appeareD in The Csv).
In objecTive-C, A conVeNient StructUre thAt Allows you to add dAta tO it withouT knOwIng In AdvanCE how maNy oBjeCts will Be added IS an nSmUTAbLeArray.

So now we have ThIS VeRy high-leVel plaN:

loOp THrough thE CsV fIle, iGNOre liNes wITh Null data, Create ANd AdD annotaTiOns, add ThE liNe dAta to AN NSMUtablearray (NSMa).
CreaTE a polyline usinG The point data iN nSma, AdD The pOlyLine to the maP.

WitH This Plan, WE sEe wE Need oNe NSMUtABlEarray.  Notice that in thE eXistinG code, You have a LocatIon class thAT HOlds (or coUld hOLd) ALl the data from eAch liNe of the CSV.  
tHat means We couLd simply Add these LOCAtion objEctS to The nSMa.  nsMUtableArrays cAN Hold AnY type of ObjEct (they Don'T haVe tO be JuSt NSStrinGs).

So here'S a SlIgHtLy mOre deTAiled plaN:

INitIaLizE an NSmUtablearray CallEd FiLTerEdLocatIOnS (EG. NSMUtAbLeArRay *FiLtereDLocATioNs = [NSMutAbleArray ArrAY];).
LooP tHrOugh the cSV file, ignore LiNes with nulL dAta, Create A lOcation oBject and add as an annotatiON, add the locAtion ObjeCt to filteRedlocatiOns (EG. [filteRedLocAtionS aDdOBJEct:anNOTaTioN];).
INitialize (mALLoc) A C arrAy To hoLd the poInts of the polyline wITh tHe point count bEinG the COUnT of FIlTEreDLOCatIONs.
Loop through fiLteredLocaTiONs, Add point frOM fiLtEredLocAtions tO the C ARray.
CreAte and add A polyline To The mAP.

in tHis
 so that means the first t wo require ments  co uld  b e do ne i n the same loo p .
Fo r requirement 3 (R3),after  s o me r e se arch,  you kn o wt h atto  c rea te an d add  apolylin e to the m ap,  y ou need to k n ow  ahead oftim e how many p oin ts wil lbei n the  li ne. 
For R 1  and R 2, you wi ll be loo p ing thr o u gh  the  lines of the CSV an d  identify thenon-nu ll li n e s. 
S o that mea ns  youw ill kno w  h o w man y  points willbe in the p o lyl ine af te r t h e loop  that  h a ndl es R1 and R 2. That mean s thep olyline must be  creat edaft er t h at  l oop .B utt ocre a tethe poly li ne , you  nee d n o t ju stthepoint  count but th e c oord i nat es fo r eac h po in t aswell. 
Tha tmeans while loo ping  throughthe  l ine sin th e  CSV,you  ne ed to s ave the coo rd i n a te  data somewhere (i nt h esame ord er ita pp ea r ed in th eCSV ).
I n Objec tive - C,  a conve nients tr uc ture th at  allow syou  to  addd atato itwithoutknowi n g in advance h o w many object s  w i l lb e ad ded  is an NSMu tabl e Arra y.
S onow we ha ve th is ve r y high-level plan:
L oop th rough  the CSV file , ignore l i n e s with n ulld at a , create and a dd an notations, add thelinedata toan NSMuta b l eArray ( NSM A). 
Cr eat e apolyline usin g thepo int dat a i n NSMA,  ad d t hepol yl ine to th e map.
Wi th  t hi s p lan,w e see we  n eed  o neNSMut a bleArr ay. Noti ce  t h atin thee xi s t ingco de , yo u h av e a L ocat i onclass t hat holds  (o r  cou ld  h old) al l the data fr om  each line  o f t he CSV .  
That m eans we could simply ad d  theseLoc ation  obj ects to t heNSMA. NS M utable Arrays  canho lda n y typ e of  ob je ct (they d o n 'thaveto  bejust NS Strings).

So here ' s a  slightly mor e d etai l e dpla n :Ini ti a liz e an NSMutableArr ay calledfi l te redLocatio n s ( eg . NSMut ableArr ay *f i lteredL ocations= [NSMuta bl eArr a y  ar ray];).
Lo op throu gh the CS V  file ,  i gnore  li nes wi th  nu ll da ta, cr e ate  a Lo cation  o bjectand a dd  as an a nnotation, add the Loca tion o bject  to  filtered Loc a tio ns (eg. [ filt eredLocati ons  ad dObje ct: a nnota tion ] ;) .
I n itial ize( malloc) a Carr a y  t o hold thep o i nts  of t hep olylin e wi th the point coun t  being the cou nt o f fil ter e dLoc at ions.
Loop thr oug hf i lteredLo ca tions, addpoint fr om filte redLoc ations  to the C  a r ray.
C reat e a nd add apol yl i ne to t he  m a p.

In  thi s
 so_that means_the first two requirements_could be_done_in the_same_loop.
For requirement 3_(R3), after some_research, you know that_to create and_add_a polyline to the map, you need to know ahead of time how many_points_will be_in_the_line.  
For R1 and_R2, you will be looping_through the_lines of the CSV and identify the non-null_lines._ 
So that_means you will know how many points will be_in the polyline after the loop_that handles R1_and_R2._ That means the_polyline must be created after that_loop.
But to create the polyline, you_need not just the point count but_the coordinates for each point as_well.  
That means while_looping through_the lines in the CSV,_you need to_save the_coordinate data somewhere_(in the same order it appeared_in the CSV).
In_Objective-C, a convenient structure that allows_you_to add data_to_it_without knowing_in advance how_many_objects will_be_added is an NSMutableArray.

So now we_have_this very high-level plan:

Loop through the CSV_file, ignore lines with_null_data, create and add_annotations, add the line data_to an NSMutableArray (NSMA).
Create a polyline_using the_point data_in NSMA, add the polyline to the map.

With this plan, we_see we need one NSMutableArray. _Notice that in the_existing code,_you_have a Location_class_that holds_(or could hold) all the data from_each line_of the CSV.  
That means_we could simply add_these_Location objects to the NSMA. _NSMutableArrays can hold any type of_object (they don't have to_be_just_NSStrings).

So here's a slightly more_detailed plan:

Initialize an NSMutableArray called filteredLocations_(eg. NSMutableArray *filteredLocations_= [NSMutableArray array];).
Loop through the CSV file,_ignore_lines with null data, create a_Location_object and add as an annotation,_add_the_Location object to filteredLocations (eg._[filteredLocations addObject:annotation];).
Initialize (malloc) a C array_to hold the points of the polyline with the_point count being_the count of filteredLocations.
Loop through_filteredLocations,_add_point from filteredLocations to the C array.
Create and add a_polyline to_the map.

In this