PDA

View Full Version : SOLVED: Using CFNetwork for FTP backup




lucasgladding
Sep 5, 2008, 09:09 AM
Has anyone had any luck linking CFNetwork or CoreServices in their iPhone app? The CFNetwork framework exists in the iPhoneOS but the compiler responds that only the umbrella CoreServices framework can be linked for the device. Unfortunately the CoreServices framework exists only in the iPhoneSimulator frameworks folder.

I'm trying to setup my application for FTP backup and restore and the CFFTPSample example code includes the majority of what I need to do so. If anyone has any advice or has had any success here, please let me know.

Thanks in advance for any assistance.

Luke Gladding



lucasgladding
Sep 5, 2008, 11:44 PM
I was able to get the frameworks linked and working and am now implementing my interface for FTP backup and restore. The CFFTPSample code can be pasted into any controller above the @implementation and called from Cocoa methods.

To anyone interested in trying this, my major findings were as follows:
- CoreServices and CFNetwork need to be conditionally linked in the build settings as per the iPhone OS Programming Guide.
- Only CFNetwork needs to be imported in the class that requires CFFTPStream and its associated functions and constants.
- Your search path for frameworks should be empty. For some reason, the project template that I started with in the initial SDK was set to search the Mac frameworks directory and resulted in warnings stating that the frameworks were not available for the iPhone.

Best of luck to anyone else trying this. Hopefully this thread helps.

Luke Gladding

rafrif
Oct 31, 2008, 08:42 PM
I was able to get the frameworks linked and working and am now implementing my interface for FTP backup and restore. The CFFTPSample code can be pasted into any controller above the @implementation and called from Cocoa methods.

To anyone interested in trying this, my major findings were as follows:
- CoreServices and CFNetwork need to be conditionally linked in the build settings as per the iPhone OS Programming Guide.
- Only CFNetwork needs to be imported in the class that requires CFFTPStream and its associated functions and constants.
- Your search path for frameworks should be empty. For some reason, the project template that I started with in the initial SDK was set to search the Mac frameworks directory and resulted in warnings stating that the frameworks were not available for the iPhone.

Best of luck to anyone else trying this. Hopefully this thread helps.

Luke Gladding

Any chance you could provide some more details? I am new to iPhone programming and I am trying to write an application that uses CFNetwork. I am getting link time errors: "ld: symbol(s) not found"

Thanks,
Martin

Pallavi002
Dec 7, 2009, 05:23 AM
"- CoreServices and CFNetwork need to be conditionally linked in the build settings as per the iPhone OS Programming Guide."

I searched for how to link CoreServices and CFNetwork conditionally in the build settings, but couldn't get through, could you please provide me the link guiding for the same ?
Thanks.

icoigo
Dec 2, 2010, 09:26 PM
I have the same problem, anyone has details about the solution?