ByDefault NSURLConnection is synchronous or asynchronous
What should be the answer for the same. And one more question is:
What is the difference between delegate and notification.
I know the difference, but I’m confused, the notification is local or Apple notification. Or there is some other feature in iPhone. Becuase i have read about NSNotificationCenter also.
Q:
ByDefault NSURLConnection is synchronous or asynchronous
A:
It depend which method you calling in NSURLConnection. But most of the method are related asynchronous. Except one that is sendSynchronousRequest:returningResponse:error:
Loading Data Synchronously
Loading Data Asynchronously
Q:
What is the difference between delegate and notification.
A:
Use delegate for one to one object communication. e.g Event received from objA call it’s delegate objB to execute it.
Use notification for one to many object communication. e.g. ObjA, ObjB registered as observer on ObjA Event. When event occur, it will send the message to both ObjA and ObjB.