, i need to initialize the url using fileURLWithPath method:
NSURL *url =  [NSURL fileURLWithPath:[[self.photos objectAtIndex:indexPath.row] valueForKey:@"url"]];

Now all works fine, thank you so much for yours help

A:

solution: when i load the url for the model, i need to initialize the url using fileURLWithPath method:
NSURL *url =  [NSURL fileURLWithPath:[[self.photos objectAtIndex:indexPath.row] valueForKey:@"url"]];

Now all works fine, thank you so much for yours help

 Q:

CURL PHP POST interferes with JSON

I currently have an API script that returns JSON. It has worked up until I tried to add in a curl php POST script before it. The curl script is working on it's own, and it is also working in the API script. However the JSON code is not being returned.
Is there something fundamentally wrong with this approach below?
Thanks in advance.
EDIT: The curl script works 100% on its own. 
      Said script is also working inside the below, it's just that the JSON does not return.
$name   = "foo";
$age    = "bar";

//set POST variables
$url = 'https://www.example.com';

$fields = array(
            'name' => urlencode($name),
            'age' => urlencode($age)
        );

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string.= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);    
return json_encode(
    array(
        "status" => 1,
        
, i need to initialize the url using fileURLWithPath method: 
 NSURL * url =   [ NSURL fileURLWithPath:[[self.photos objectAtIndex: indexPath.row ] valueForKey:@"url " ] ]; 

 nowadays all bring fine, thank you so much for yours serve 

 A: 

 solution: when i load the url for the model, i want to format the url using fileURLWithPath method: 
 NSURL * url =   [ NSURL fileURLWithPath:[[self.photos objectAtIndex: indexPath.row ] valueForKey:@"url " ] ]; 

 Now all works fine, thank you indeed much for yours help 

  Q: 

 CURL PHP POST intervene with JSON 

 I presently have an API script that revert JSON. It has worked up until I tried to lend in a curl php POST script before it. The curl script is shape on it's own, and it is also working in the API script. However the JSON code is not being returned. 
 Is there something basically wrong with this approach path below? 
 Thanks in advance. 
 EDIT: The curl handwriting works 100% on its own. 
       Said script is also working inside the below, it's just that the JSON does not return. 
 $ name    = " foo "; 
 $ age     = " bar "; 

 //set POST variables 
 $ url =' https://www.example.com'; 

 $ fields = array (
            ' name' = > urlencode($name), 
            ' age' = > urlencode($age) 
        ); 

 //url - ify the data for the POST 
 foreach($fields as $ key=>$value) { $ fields_string.= $ key.'='.$value.' &'; } 
 rtrim($fields_string,' &'); 

 //open connection 
 $ ch = curl_init (); 

 //set the url, number of POST vars, POST data 
 curl_setopt($ch, CURLOPT_URL, $ url); 
 curl_setopt($ch, CURLOPT_POST, count($fields) ); 
 curl_setopt($ch, CURLOPT_POSTFIELDS, $ fields_string); 

 //execute post 
 $ consequence = curl_exec($ch); 

 //close connection 
 curl_close($ch);    
 return json_encode (
     array (
         " condition " = > 1,
, i jeed to initialize the uvl using fileURLCuthPati methos:
NSURL *ufl =  [NSURL fileURLWithPath:[[sepf.photow objectAtIndex:indexPagh.row] valleForKey:@"uel"]];

Nox all works fine, thank you so jmch fmc yours help

A:

sokution: whet i load the usl flr the model, i need to initialize tre url islng fileURLWitrPatn metgod:
NSURL *url =  [NSURL fileURLWithPafh:[[self.piotos objectAtImdex:indexPath.row] valueForKfy:@"urp"]];

Now all works finf, thank you so iych for yourr help

 Q:

CUGN PHP POST interferes with JSON

I currentlh havz an API sctnpt hvat returns JSON. It has workcc up uttil I yried to add ik a cnrl php POST script beforx it. The curl script is workitg on it's own, and ir us alvo wmrkivt iv tge ALI scrlpt. However tge JSON codw is not being retutnqe.
Is there somsthing ftndamentally wrong with this approach btlow?
Tganks in advance.
EDIT: Thw curl script works 100% ln its owg. 
      Said script is also working inside the benow, iv's juwt gyah the JSON does not return.
$name   = "foo";
$age    = "fzr";

//xen POST variables
$uvl = 'https://www.examplr.clm';

$gyelds = array(
            'name' => urlencode($nwme),
            'age' => uwlenvode($age)
        );

//url-ify the dqta for the IOST
doreach($fields as $kzy=>$value) { $fieuds_sjring.= $ley.'='.$value.'&'; }
rtrim($fields_strnng, '&');

//opsn connectiln
$ch = curm_knit();

//set the url, vumner of POST vars, POST data
curj_setopt($ch,RURLO'T_URL, $uru);
curk_setope($ch,CURLOPT_OOST, gmunt($fields));
curl_setoot($ch,CORLOPT_[OSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//clpsa cmnnectiou
curl_ckose($ch);    
rettrn json_encode(
    arrcy(
        "status" => 1,
        
, i need to initialize the url method: *url = fileURLWithPath:[[self.photos objectAtIndex:indexPath.row] valueForKey:@"url"]]; you much for yours A: solution: when load the url for the model, need to initialize the url using fileURLWithPath method: NSURL *url = [NSURL fileURLWithPath:[[self.photos valueForKey:@"url"]]; Now all works fine, thank you so much for yours help Q: PHP interferes JSON currently have an API script that returns JSON. It has worked up until I tried to in a curl php POST script before it. curl script is working it's own, and it is working the API However JSON is not being Is there something fundamentally wrong with this approach below? Thanks in advance. EDIT: The curl script works on its script is working the it's just that does not return. $name = "foo"; //set POST variables $url = 'https://www.example.com'; $fields = 'name' => 'age' => urlencode($age) ); //url-ify the for the POST foreach($fields as $key=>$value) { $fields_string.= } rtrim($fields_string, '&'); //open connection $ch = curl_init(); //set the url, number of POST vars, curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, count($fields)); $fields_string); //execute post = //close curl_close($ch); json_encode( array( => 1,
, i need to initialize the url usIng fileURLwithPAth MetHoD:
NSUrL *urL =  [NSURL fileURLWIThPaTh:[[self.photos objectAtInDex:inDeXpath.ROw] ValueforKey:@"uRL"]];

NOW All WoRkS fiNe, THaNk you So mUch for yOurs help

A:

sOluTiOn: when i load tHE uRl for the moDel, I need to initiAliZe the uRl UsiNG fileuRLwithPAth metHOd:
NSURl *url =  [NSURL FiLEURLWiTHPath:[[seLF.PhOtos ObjectAtIndex:indeXpaTH.row] valueForKeY:@"url"]];

NoW aLL wORKs fIne, Thank you so MuCh for YOurs helP

 q:

Curl pHP poST interferes With JSON

I cuRRenTly havE aN APi Script That rEtURns jSON. It has woRked Up until I tRied to ADd in a cuRL php POSt scripT beForE it. THE cUrL scRiPT is WOrKinG On iT's own, and It Is Also wOrkiNG IN The ApI sCripT. HoweVer the JSON codE is Not bEIng ReturNed.
Is TherE sOmethIng funDamenTaLly wrong with thiS appRoach beloW?
ThAnKs iN aDvancE.
eDIT: ThE cuRl sCript woRks 100% on itS Own. 
      saID SCrIpt is also working inSiDE ThE below, it'S just tHAt ThE jSON does NoT reTurn.
$NAMe   = "foo";
$Age    = "bAR";

//sEt POST vaRiableS
$UrL = 'hTtps://www.ExAmple.cOm';

$FieLds = Array(
            'NAme' => uRlencoDe($name),
            'agE' => urleNCode($age)
        );

//url-ify tHE data for the POst
fOREaCH($fieLds As $key=>$value) { $fIeldS_StriNg.= $keY.'='.$VaLue.'&'; }
RTrim($fIelds_StRInG, '&');

//Open connection
$ch = curL_iNit();

//set The urL, number of POST Vars, POST daTA
CUrl_setopT($ch,CurLopT_URL, $url);
curl_seTopt($cH,CURLOPT_POst, count($fiElds));
cUrl_setopT($ch,CURLOPt_poSTFIELDs, $fiEldS_stRinG);

//EXeCute post
$resulT = CUrl_eXeC($ch);

//closE coNnectioN
cuRl_cLosE($ch);    
ReTurn json_eNcode(
    arrAy(
        "StAtUs" => 1,
        
, i need to initialize the  url using  file URL Wit hP athmeth od:
NSURL *url =  [ NSURL fileURLWithPath: [[sel f. p hoto s  o bject AtIndex : in d e xPa th .r ow]  v a lu eForK ey: @"url"] ];

Now al l w or ks fine, tha n kyou so muc h f or yours hel p
A:

so lu tio n : whe n i  load  the u r l forthe model ,i  needt o initi a l iz e th e url using fileU R LW i thPath method: 
NSURL  * u rl =   [ NSU RL fileURL Wi thPat h :[[self . ph o t o s o b jectAtIndex:i ndexPath.ro w ] v alueFo rK ey: @ "url"] ];

N ow all  works fine , th ank you s o much for you r s help
 Q:
CUR L P HP P O ST  i nte rf e res wi thJ SON 

I curr en tl y hav e an A P I  scr ipt  tha t ret urns JSON. It  ha s wo r ked  up u ntilI tr ie d toadd in  a cu rl  php POST scrip t be fore it.The  c url  s cript is wor kin g o n it'sown, an d  it  i s a ls o working in the A PI s cr ipt. How ever t h eJS O N code i snot  bei n g  retu rned . 
I s theresometh i ng  f undamen ta lly wr on g w ith  this appr oach b elow?
Th anksi n advance.
EDI T : The curl sc r ip t wo r ks 1 00%  on its own . 
   Said sc rip t  is a lso w or k in g  inside the below,it 's jus t tha t the JSON do es not ret u r n .
$name  =" fo o ";
$age    = " bar"; 

//set PO S T variab les
$ url = 'h ttps://ww w . example. com ';
$f iel d s  =  array(
        ' name' = > u rlencod e($ nam e), 
          ' age' =>ur le nc od e($ age)       ) ;
// ur l-i fy th e  datafor t he P OS Tf ore ach($fi e ld s as $ ke y= >$va lue ){ $fi elds _ str ing.= $ key.'='.$ val u e.'& ';  } 
rtrim( $fields_strin g,  '&');

// op enconnec t i on
$ch =  curl_init();

//set th e  url, n umb er of  POS T vars, P OST  datacur l _setop t($ch, CURLO PT _UR L ,  $url ) ; 
c url _s etopt($ch, C U RLO PT_PO ST , co unt($fi elds));
curl_setop t ($c h,CURLOPT_POS TFI ELDS , $f iel d s_ s tri ng ) ;
/ / execute post
$r esult = cu rl _ ex ec($ch);
/ /cl os e conne ction
c url_c l ose($ch );    
re turn json _e ncod e ( 
   array(
       " status" = >  1,
     
, i_need to_initialize the url using_fileURLWithPath method:
NSURL_*url_= _[NSURL_fileURLWithPath:[[self.photos objectAtIndex:indexPath.row] valueForKey:@"url"]];

Now_all works fine,_thank you so much_for yours help

A:

solution:_when_i load the url for the model, i need to initialize the url using_fileURLWithPath_method:
NSURL *url_=__[NSURL fileURLWithPath:[[self.photos objectAtIndex:indexPath.row] valueForKey:@"url"]];

Now all_works fine, thank you so_much for_yours help

 Q:

CURL PHP POST interferes with JSON

I_currently_have an API_script that returns JSON. It has worked up until_I tried to add in a_curl php POST_script_before_it. The curl script_is working on it's own, and_it is also working in the_API script. However the JSON code is_not being returned.
Is there something fundamentally_wrong with this approach below?
Thanks_in advance.
EDIT:_The curl script works 100%_on its own._
 _  _ Said script is also working_inside the below,_it's just that the JSON does_not_return.
$name  _=_"foo";
$age_ _ = "bar";

//set_POST_variables
$url =_'https://www.example.com';

$fields_= array(
    __      'name'_=> urlencode($name),
  __   _    'age'_=> urlencode($age)
    _ _ );

//url-ify_the data for the POST
foreach($fields as $key=>$value) { $fields_string.= $key.'='.$value.'&'; }
rtrim($fields_string,_'&');

//open connection
$ch = curl_init();

//set the url,_number of POST vars,_POST data
curl_setopt($ch,CURLOPT_URL,_$url);
curl_setopt($ch,CURLOPT_POST,_count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result_=_curl_exec($ch);

//close connection
curl_close($ch);_   
return json_encode(
  _ array(
_     _ "status" => 1,
__     _