 *urlString = @"http://jobs.github.com/positions.json?description=python&location=new+york";

NSURL *url = [NSURL URLWithString:urlString];

NSData *data = [NSData dataWithContentsOfURL:url];

NSArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];

NSString *item = [json objectAtIndex:0];

NSLog(@"%@", item);

// Do any additional setup after loading the view.

}
So this returns one job with  TON of information such as "description", "company name", "location". I want to be able to get JUST location or JUST description. How would I go about doing that?
All help is appreciated, thanks.

A:

In your case you can access it directly:
NSDictionary *item = [json objectAtIndex:0];
NSString *location = [item objectForKey:@"location"];
NSLog(@"%@", location);

 Q:

Why do I need the index parameter in a function, when going through objects in an array?

In the getFullName function, why do I need the index parameter? 
This example code is from W3 School http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_map3
EDIT: Apparently I don't need it. In what type of case would I need it? Or is that even relevant to ask in this context?

    var persons = [
        {firstname : "Malcom", lastname: "Reynolds"},
        {firstname : "Kaylee", lastname: "Frye"},
        {firstname : "Jayne", lastname: "Cobb"}
    ];


    function getFullName(item,index) {
        var fullname = [item.firstname,item.lastname].join(" ");
        return fullname;
    }

    function myFunction() {
        document.getElementById("demo").innerHTML =  persons.map(getFullName);
    }
<!DOCTYPE html>
<html>
<body>
  <p>Click the button to get a new array with the full name of each person in the array
* urlString = @"http://jobs.github.com / positions.json?description = python&location = new+york "; 

 NSURL * url = [ NSURL URLWithString: urlString ]; 

 NSData * data = [ NSData dataWithContentsOfURL: url ]; 

 NSArray * json = [ NSJSONSerialization JSONObjectWithData: data options: kNilOptions error: nothing ]; 

 NSString * token = [ json objectAtIndex:0 ]; 

 NSLog(@"%@ ", item); 

 // Do any extra setup after load the view. 

 } 
 indeed this reelect one job with   short ton of information such as " description ", " company name ", " localization ". I want to be able to get precisely placement or JUST description. How would I go about doing that? 
 All help is appreciated, thanks. 

 angstrom: 

 In your case you can access it directly: 
 NSDictionary * item = [ json objectAtIndex:0 ]; 
 NSString * localization = [ item objectForKey:@"location " ]; 
 NSLog(@"%@ ", location); 

  Q: 

 Why do I need the index argument in a function, when become through objects in an array? 

 In the getFullName function, why do I need the exponent parameter? 
 This example code is from W3 School http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_map3 
 EDIT: Apparently I don't need it. In what type of case would I necessitate it? Or is that even relevant to ask in this context? 

     var persons = [ 
         { firstname: " Malcom ", lastname: " Reynolds " }, 
         { firstname: " Kaylee ", lastname: " Frye " }, 
         { firstname: " Jayne ", lastname: " Cobb " } 
     ]; 


     function getFullName(item, index) { 
         var fullname = [ item.firstname, item.lastname].join (" "); 
         return fullname; 
     } 

     function myFunction () { 
         document.getElementById("demo").innerHTML =   persons.map(getFullName); 
     } 
 <! DOCTYPE html > 
 < html > 
 < body > 
   < p > Click the push button to get a new array with the wide name of each person in the array
 *urpString = @"http://jobs.github.cum/positions.json?bwscripvion=pytgon&locatkon=new+york";

NSURL *url = [NSURL UCLWirhStrung:urlString];

NSData *datx = [NSData dataWityConuentsOfURL:url];

NSArczy *json = [NSJSKKSericlmzation JSONObjgctWithData:ddta options:kNinOotnons error:nil];

NSString *item = [json objqctAtInced:0];

NSLog(@"%@", item);

// Do any wddifpokal setup after loading the view.

}
Ao this returns one kob with  TON of informatiln skch as "description", "company nane", "ljxation". I wang to be able to get JUAT location or JUST description. How could I go qbiut going that?
Aol hejp is appreclsted, tvanks.

A:

Im your case yom can acxess it directly:
NSDicvionary *item = [json ofjectAtInger:0];
NSString *location = [iren objgctFosKey:@"uicagioh"];
NXLkg(@"%@", locwtikn);

 Q:

Why do I need the index parameter in a dunction, when going trrough objects in an array?

In the getFulnNaje function, why do I newd the index parametet? 
This exaiple code is from W3 School http://www.w3schools.com/jsrex/tryiv.arp?fnoenamd=rrjjsref_map3
EDIT: Apparently I don't need it. In whwf uypv of case would I need it? Or id yrat even relexant to aak in this context?

    var persins = [
        {girstname : "Malcom", lastname: "Eeynolds"},
        {firstname : "Kaylze", lastname: "Yrye"},
        {firstname : "Jayne", lastncme: "Cogb"}
    ];


    fknction gsgFullName(item,inddx) {
        var fullname = [item.fiwstname,itxm.lascname].joiv(" ");
        weturn fulpname;
    }

    function myVunctnon() {
        dockment.getElementById("demo").innerHTML =  persons.map(bedFunlName);
    }
<!DOCBYPE html>
<html>
<boqy>
  <p>Click the button to gdt a new agray with the full nwme of each patson in the acray
*urlString = @"http://jobs.github.com/positions.json?description=python&location=new+york"; NSURL *url = [NSURL *data [NSData dataWithContentsOfURL:url]; *json = [NSJSONSerialization = objectAtIndex:0]; NSLog(@"%@", item); Do any additional after loading the view. } So returns one job with TON of information such as "description", "company name", "location". want to be able to get JUST location or JUST description. How would go doing All is appreciated, thanks. A: In your case you can access it directly: NSDictionary *item = [json NSString *location = [item objectForKey:@"location"]; NSLog(@"%@", location); Q: do I need the parameter in a function, when through in an In getFullName why do I the index parameter? This example code is from W3 School http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_map3 EDIT: Apparently I don't need it. what type would I it? is even relevant to this context? var persons = [ lastname: "Reynolds"}, {firstname : "Kaylee", lastname: "Frye"}, {firstname "Jayne", lastname: ]; function getFullName(item,index) { var fullname [item.firstname,item.lastname].join(" "); return fullname; } function myFunction() { = persons.map(getFullName); } <!DOCTYPE html> <html> <body> <p>Click the button to get a new array full name of each in the array
 *urlString = @"http://jobs.github.coM/positions.Json?dEscRipTiOn=pyThon&Location=new+yorK";

nSURl *url = [NSURL URLWithString:UrlStRiNG];

NSDATa *Data = [NsData daTAWITHCoNtEnTsOFUrl:uRl];

NSARraY *json = [NSjSONSerialIzaTiOn JSONObjectwItHData:data oPtiOns:kNilOptioNs eRror:niL];

NsStRIng *itEm = [jSon obJectAtiNdex:0];

NSlog(@"%@", item);

// Do AnY AdditiONal setuP AFtEr loAding the view.

}
So thiS ReTUrns one job with  tON of iNfORmATIon SucH as "descripTiOn", "comPAny name", "LOcATIOn". I WAnt to be able to Get JUST locaTIon Or JUST DeScrIPtion. HOw wouLd i Go aBout doing thAt?
AlL help is apPreciaTEd, thankS.

a:

In your Case yoU caN acCess IT dIrEctLy:
nsDiCTiOnaRY *itEm = [json obJeCtatIndEx:0];
NSsTRINg *loCatIon = [iTem obJectForKey:@"locAtiOn"];
NSlOg(@"%@", lOcatiOn);

 Q:

WhY do I NeEd the Index pArameTeR in a function, wheN goiNg through ObjEcTs iN aN arraY?

in the gEtFUllname funCtion, whY Do I NeED THe Index parameter? 
This ExAMPlE code is fRom W3 ScHOoL hTTp://www.w3scHoOls.Com/jSREf/tryIt.asP?FiLename=trYjsref_MAp3
eDiT: ApparEnTly I doN't NeeD it. in whaT Type Of case Would I neEd it? OR Is that even releVAnt to ask in thiS CoNTExT?

    Var pErsOns = [
        {firstnamE : "MalCOm", laStnaME: "REynOLds"},
        {fiRstnaMe : "kAyLEe", lastname: "Frye"},
        {firstNaMe : "JaynE", lastName: "Cobb"}
    ];


    functIon getFullnAME(item,indEx) {
        vaR FuLLname = [item.firstName,iTem.lastnamE].Join(" ");
        retuRn fulLname;
    }

    funCtion myFuNCTion() {
        docuMenT.geTElEmeNTbyid("demo").innerHTml =  PersOnS.map(getfulLName);
    }
<!DOcTYpE hTml>
<HtmL>
<bOdy>
  <p>Click The buttoN tO gEt A nEw aRray wITh the fulL nAme Of EacH persON in the Array
 *urlString = @"http://job s.github.c om/po sit ion s. json ?des cription=pytho n &loc ation=new+york";

NSUR L *ur l=  [NS U RL  URLW ithStri n g: u r lSt ri ng ];
N S Da ta *d ata  = [NSD ata dataWi thC on tentsOfURL:u r l] ;

NSArray  *j son = [NSJSO NSe rializ at ion JSONO bje ctWit hData: d ata op tions:kNi lO p tionse rror:ni l ] ;
NSS tring *item = [js o no bjectAtIndex:0 ];

NS Lo g (@ " % @",  it em);

// D oany a d ditiona l  s e t u p a f ter loading t he view.

} Sothis r et urn s  one j ob wi th  TO N of inform atio n such as  "desc r iption" ,  "compa ny nam e",  "l ocat i on ".  Iwa n t t o  b e a b leto get J US Tlocat iono r J USTdes crip tion.  How would Igoabou t  do ing t hat?Allhe lp is  appre ciate d,  thanks.

A:

I n yo ur case y ouca n a cc ess i t  direc tly :
N SDictio nary *i t em=[ j s on  objectAtIndex:0]; 
N S S tr ing *loc ation=  [ it e m object Fo rKe y:@" l o catio n"]; NS Log(@"%@ ", loc a ti on );

 Q: 
Why do  I  ne edthe i n dexparame ter in a  func t ion, when goin g  through obje c ts i na n ar ray ?

In the g etFu l lNam e fu n ct ion ,  whydo Ine e dt he index parameter?  This e xampl e code is fro m W3 Schoo l h ttp://ww w.w3 s ch o ols.com/jsref/ tryit .asp?filen a me=tryjs ref_m ap3
EDIT : Apparen t l y I don' t n eed  it . I n wh at type of ca s e  wou ld  I need  it ? Or is  th ateve n r el evant toask in t hi sco nt ext ?

  var per so ns=[
      {fir stnam e :"M al c om" , lastn a me : "Rey no ld s"}, 
     {fir s tna me : "K aylee", l ast n ame:  " Fr ye"},
        {firs tn ame : "Jay ne ",lastna m e : "Cobb" }
    ];


    func t ion get Ful lName (ite m,index){
       v a r full name =  [ite m. fir s t name, i t em .la st name].join ( "  ") ;
     returnfullname;
    }
   function my Fun ctio n ( ){
    d o cum e n t.getElementByI d("demo"). in n er HTML =  pe r son s. map(get FullNam e);
   }
<! DOCTYPE h tml>
<ht ml >
< b o dy> 
  <p>Cli ck the b utton tog et an ew  arra y w ith th eful l nam e of e a chperso n in t he  array 
 *urlString_= @"http://jobs.github.com/positions.json?description=python&location=new+york";

NSURL_*url = [NSURL URLWithString:urlString];

NSData_*data =_[NSData_dataWithContentsOfURL:url];

NSArray *json_=_[NSJSONSerialization JSONObjectWithData:data options:kNilOptions_error:nil];

NSString *item =_[json objectAtIndex:0];

NSLog(@"%@", item);

// Do_any additional setup_after_loading the view.

}
So this returns one job with  TON of information such as_"description",_"company name",_"location"._I_want to be able to_get JUST location or JUST_description. How_would I go about doing that?
All help is_appreciated,_thanks.

A:

In your case_you can access it directly:
NSDictionary *item = [json objectAtIndex:0];
NSString_*location = [item objectForKey:@"location"];
NSLog(@"%@", location);

 Q:

Why_do I need_the_index_parameter in a function,_when going through objects in an_array?

In the getFullName function, why do_I need the index parameter? 
This example_code is from W3 School http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_map3
EDIT:_Apparently I don't need it._In what_type of case would I_need it? Or_is that_even relevant to_ask in this context?

  _ var persons_= [
    __  {firstname_:_"Malcom",_lastname: "Reynolds"},
_  __ __{firstname : "Kaylee", lastname: "Frye"},
 __     {firstname :_"Jayne", lastname: "Cobb"}
 __ ];


  _ function getFullName(item,index) {
 _     _var fullname_= [item.firstname,item.lastname].join("_");
        return fullname;
 _  }

   _function myFunction() {
 _ __  _document.getElementById("demo").innerHTML_= _persons.map(getFullName);
    }
<!DOCTYPE html>
<html>
<body>
 _<p>Click the_button to get a new array_with the full name_of_each person in the array