Month: November 2011

CALayer Properties cannot be accessed in XCode 4.2 Lion

I am using XCode 4.2 with Lion 1.7


Property 'anchorPoint' cannot be found in forward class object 'CALayer *'
Property 'cornerRadius' cannot be found in forward class object 'CALayer *'
Property 'borderWidth' cannot be found in forward class object 'CALayer *'

This was the error I was getting when ever I was trying to access the properties of layer class. Just one import solved all my problems and I got the things working

Import the QuartzCore.framework in your resources and you need to import the following in the class you want to access the properties of layer.

#import

I hope this helps

Replacing file_get_contents function with curl. Alternate for file_get_contents

Hi all

If your server does not support the file_get_contents function for php and it does not allow the url access this is the shortest and best alternate.

//$dataResponse = file_get_contents($request_url); // Error Check
//$data = json_decode($dataResponse);

$dataResponse =$this->curl_file_get_contents($request_url);
$data = json_decode($dataResponse);

function curl_file_get_contents($request)
{
$curl_req = curl_init($request);

curl_setopt($curl_req, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl_req, CURLOPT_HEADER, FALSE);

$contents = curl_exec($curl_req);

curl_close($curl_req);

return $contents;
}///end of functn curl File get contents

the above function will work exactly same as file content url