| Mac Cocoa |
| Author |
Message |
XNote Kapetan
Joined: 16 Jun 2006 Posts: 460
|
Posted: Mon Apr 13, 2009 7:37 pm Post subject: Networking & data transfer |
|
|
iphonedevsdk.com - How to upload and download from http server?
"I'm having trouble figuring this out, or finding an easy solution. I figured out
the downloading part I think from the apple docs." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Fri Apr 17, 2009 12:37 am Post subject: |
|
|
Atrexis Blog - iPhone - Establishing an HTTP Connection
"I will be making a request to an image, then displaying the received image
on the screen. After that, I will save the image to the Photo album in the
iPhone." |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
Posted: Fri Apr 24, 2009 1:10 am Post subject: |
|
|
iphonedevsdk.com - Send files over socket connection
"-- want to send files to iphone over socket connection/wifi; so downloaded ASyncSocket which generates plenty of build errors related to Jam deprecated.
... trying to connect to my c++ windows socket software -- which works fine between to windows machines over port 8686.
I got this code from this forum, which so far does nada, but eventually goes to NSStreamEventErrorOccurred in the debugger:
So which port do I use? -- tried 2222; 3258; 60000; and 8686
Make the iphone the client or the server?" |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Wed May 20, 2009 3:06 pm Post subject: |
|
|
iphonedevsdk.com - Retrieving a set of data from my own webserver
"I plan to have a MySQL database on my server, from which I would query
and retrieve several different types of data. Namely, I'd be retrieving data
from CHAR (text), date, and BLOB (image) columns." |
|
| Back to top |
|
 |
XNote Kapetan
Joined: 16 Jun 2006 Posts: 460
|
Posted: Fri Jun 05, 2009 6:00 pm Post subject: |
|
|
mobileorchard.com - Tutorial: Networking and Bonjour on iPhone
"In this tutorial, we are going to explore a simple chat application for the
iPhone. It allows you to host your own chat room and advertise it on your
local Wi-Fi network (in which case your app acts as a chat “server”) or find
and join chat rooms hosted by other people on your network (acting as a
chat “client”)." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
|
| Back to top |
|
 |
XNote Kapetan
Joined: 16 Jun 2006 Posts: 460
|
Posted: Sat Jun 27, 2009 4:52 pm Post subject: |
|
|
MF - Networking with a lab instrument
"We recently received a new piece of equipment for the lab, which has a net-
work interface. Since I already have myCocoaSoftware for the analysis, why
not try to extend this to include measurements as well." |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Wed Jul 22, 2009 2:00 am Post subject: |
|
|
Brian Hall - Beej's Guide to Network Programming
"Hey! Socket programming got you down? Is this stuff just a little too
difficult to figure out from the man pages? You want to do cool Internet
programming, but you don't have time to wade through a gob of structs
trying to figure out if you have to call bind() before you connect(), etc.,
etc.
Well, guess what! I've already done this nasty business, and I'm dying to
share the information with everyone! You've come to the right place. This
document should give the average competent C programmer the edge
s/he needs to get a grip on this networking noise.
And check it out: I've finally caught up with the future (just in the nick of
time, too!) and have updated the Guide for IPv6! Enjoy!" |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Wed Aug 05, 2009 2:50 pm Post subject: |
|
|
MF - Progress bar while upload file - Code which I am using for file
upload
"NSURLConnection sendSynchronousRequest: blocks the current thread until
it completes. Either run this is a separate thread and update the UI on the
main thread or use the asychronous methods of NSURLConnection as clearly
described in the documentation." |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
Posted: Sat Aug 15, 2009 8:58 pm Post subject: |
|
|
How to Make Your iPhone App Send Email with Attachments,
by MATTJDRAKE, How to Make iPhone Apps
"In iPhone OS 3.0 you can easily send pictures and voice recordings from
your app in an email. In fact, now your emails can be easily formated using
HTML and once the user has finished the email control returns back to your
app. Pretty nifty!" |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
Posted: Thu Aug 20, 2009 8:46 pm Post subject: |
|
|
iphonedevsdk.com - Cannot HTTP POST to Server, returns empty $_POST
"You should probably implement the NSURLConnectionDelegate didFailWith-
Error method. Also, dont show your alert in didRecieveData. The data may
not all be downloaded. Instead, create an NSMutableData object and append
data in didRecieveData. Then in your didFinishLoading delegate, you can
show the alert with the full contents of the data." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sun Aug 30, 2009 11:34 pm Post subject: |
|
|
praveenmatanam.wordpress.com - Avoiding WiFi disconnections
* UIRequiresPersistentWiFi *
"Any iPhone application that requires a WiFi connection must set UIRequires-
PersistentWiFi to <true/>, otherwise the iPhone will abruptly disconnect the
WiFi connection after 30 minutes of use." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sun Aug 30, 2009 11:43 pm Post subject: |
|
|
davidjhinson.wordpress.com - iPhone Email Attachments – Revisited
"Gmail simply will not let you see embedded images. Period."
Objective-C and HTTP Basic Authentication
"Base64 encoding is used to convert binary data into text that can be trans-
mitted using HTTP (like, say, for embedding images in email) or for some-
what obfuscating user ids and passwords to be sent “in the clear” over HTTP
(like for Basic Authentication). ... And here is how one may transmit a user
id and password (using NSURLConnection) to establish a connection using
Basic Authentication" |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
Posted: Tue Sep 15, 2009 3:50 pm Post subject: |
|
|
SO - How to use bluetooth to connect two iPhone?
"I want to use iPhone SDK to implement a bluetooth connection between two
iPhones, but I don't find any bluetooth API in iPhone SDK 3.0." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sun Sep 20, 2009 2:39 am Post subject: |
|
|
iphonedevsdk.com - MFMailComposeViewController: image attachment
"The image is correctly displayed when I send the email, but when I receive
it the image cannot be displayed because it contains some errors." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sat Oct 03, 2009 1:45 am Post subject: |
|
|
adc - CFNetServiceCreate() - CFNetServices Reference
| Code: | CFNetServiceRef CFNetServiceCreate (
CFAllocatorRef alloc,
CFStringRef domain,
CFStringRef serviceType,
CFStringRef name,
SInt32 port
); |
"If the CFNetService is to run in asynchronous mode, call CFNetService-
SetClient to prepare the service for running in asynchronous mode. Then
call CFNetServiceScheduleWithRunLoop to schedule the service on a run
loop. Then call CFNetServiceRegister to make the service available."
Last edited by delovski on Sat Oct 03, 2009 2:22 am; edited 1 time in total |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sat Oct 03, 2009 2:22 am Post subject: |
|
|
adc - CFSocketSetAddress() - CFSocket Reference
| Code: | CFSocketError CFSocketSetAddress (
CFSocketRef s,
CFDataRef address
); |
"Binds a local address to a CFSocket object." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sat Oct 03, 2009 2:27 am Post subject: |
|
|
adc - CFSocketCopyAddress() - CFSocket Reference
| Code: | CFDataRef CFSocketCopyAddress (
CFSocketRef s
); |
"The local address, stored as a struct sockaddr in a CFData object, of s." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sat Oct 03, 2009 3:06 am Post subject: |
|
|
iphonedevsdk.com - CFNetwork Memory Leak
"There is a 3.5k leak that's been reported quite a bit related to networking.
Is that what you're seeing? It's an OS bug. There's no workaround." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Thu Jan 21, 2010 1:05 am Post subject: |
|
|
MF - How to code a network application
"Basically what im trying to do is have the iPhone act as a 'client' and
connect to a OSX application 'server'." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Fri Jan 22, 2010 9:08 am Post subject: |
|
|
MF - Bonjour, NSStream and Multicast
"I need to send the same data to a whole heap of iPhones at once (potenti-
ally thousands) from a single Mac. These iPhones are all on the same wire-
less network." |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
Posted: Wed Feb 17, 2010 9:03 pm Post subject: |
|
|
MF - Gamekit API
"I know I can't connect because of limitations of the iPhone simulator, but
what I do know is that the simulator detects available peers and you can
see the name in the GKPeerPickerViewController interface." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sun Mar 28, 2010 9:09 pm Post subject: |
|
|
MF - Simple Network Code
"Use AsyncSocket: http://code.google.com/p/cocoaasyncsocket/
It's pretty easy to work with, if you have some Cocoa skills. The first time
I used it, I was very new to Cocoa and Objective-C, but quite experienced
with Java and other programming languages. I had it interoperating with
Java networking apps in only a few days worth of playing with it." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Mon Apr 19, 2010 12:17 am Post subject: |
|
|
zachwaugh - Programmatically Retrieving IP Address of iPhone
"There are some undocumented methods that work ([NSHost addresses]),
but I didn’t want to risk them pulling that out of there and my app breaking.
So I wrote some C code (cobbled together from various sources) that will
loop through the network interfaces and retrieve the IP address." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Wed May 05, 2010 4:57 pm Post subject: |
|
|
Jeff LaMarche - NSStream: TCP and SSL
"The way that we enable SSL encryption is to simply use setProperty:forKey:
on both streams, setting the key NSStreamSocketSecurityLevelKey to a
value that specifies the version of SSL to use. If you want to tell NSStream
to use the highest version supported in common with the remote connection,
specify NSStreamSocketSecurityLevelKey. That's what you'll usually want." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Mon May 24, 2010 6:23 pm Post subject: |
|
|
so - iPhone SDK: Storing username and password in the code
"If this is FTP, then you are sending the credentials over the network unen-
crypted. If you expect to protect these credentials, you've already lost,
because anyone with any interest can easily sniff the password off of the
wireless network." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Mon May 24, 2010 11:31 pm Post subject: |
|
|
Jeff LaMarche - Downloading Images for a Table without Threads
"I've written a small iPhone app that downloads images from Deviant Art.
You just enter somebody's Deviant Art username into a text field and the
application will grab the the images in that person's gallery, download them
asynchronously, and display each one in the table once it's finished down-
loading."
Nice comments: Neil Mix, Chris Gummer, plus more by Jeff:
"Have you actually gotten the application to crash by hitting the back but-
ton? I haven't. I think your reasoning misses an important point: NSURL-
Connection is one of the few classes that actually retains its delegate. As
long as the request is active, the delegate won't go anywhere.
The documentation does not make this point obvious, but it is easy to con-
firm by checking the retain count in the debugger."
Last edited by delovski on Thu Aug 05, 2010 10:35 pm; edited 3 times in total |
|
| Back to top |
|
 |
Ike Kapetan
Joined: 17 Jun 2006 Posts: 887 Location: Europe
|
Posted: Mon Jun 28, 2010 1:27 pm Post subject: |
|
|
MF - Using POST method to get the cookies(by clicking button)
"And then the user has to click a button to submit the data through the
url POST method and then the cookies of the website will be return to
the application. There are some http 302 (redirect) or 303 in some of
the website." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Thu Jul 29, 2010 11:55 pm Post subject: |
|
|
so - iPhone : upload image to web aspx file
"I have a little problem. I have to upload a photo from my iPhone to a web
server with POST Method but the server file is in aspx. I tried my code with
my server and PHP file : works well ! Now with aspx file : doesn't upload..." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Sat Jul 31, 2010 12:07 am Post subject: |
|
|
iphonedevsdk.com - Sending JSON to a URL
"So, for instance if my remote database is called 'SportsData', located at
http://www.website.com, with tables 'event' and 'user' and I want to send
it the following query." |
|
| Back to top |
|
 |
delovski
Joined: 14 Jun 2006 Posts: 2142 Location: Zagreb
|
Posted: Thu Aug 05, 2010 9:36 pm Post subject: |
|
|
so - Handling redirects correctly with NSURLConnection
"The idea here is that instead of cloning the new request and trying to shape
it the same as the one Cocoa Touch sends me, I create a clone of the origi-
nal request and change just the URL to match the request Cocoa Touch sent
me." |
|
| Back to top |
|
 |
XNote Kapetan
Joined: 16 Jun 2006 Posts: 460
|
|
| Back to top |
|
 |
|