Questions tagged [nsconnection]

Questions regarding Apple's NSConnection class

Apple's NSConnection Class

An object that manages the communication between objects in different threads or between a thread and a process running on a local or remote system.

Docs: https://developer.apple.com/documentation/foundation/nsconnection

Famous Question: Best way to do interprocess communication on Mac OS X

38 questions
1
vote
2 answers

NSURLConnection not giving error with internet connection disabled?

Just wondering about this code below... when I turn off my internet connection and run it, I expected I would get "Connection failed" in my console log. Can anyone explain why I'm not? Thanks. NSString *urlString = [NSString…
sayguh
  • 2,540
  • 4
  • 27
  • 33
1
vote
2 answers

How to set real timeout for NSURLConnection request?

Please look to the following code: NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:<...> cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:3.0]; <...> [NSURLConnection sendSynchronousRequest:request…
Dmitry
  • 14,306
  • 23
  • 105
  • 189
1
vote
1 answer

Make NSConnection stall until connection for registered name is found

Is there any way to have NSConnection search for a connection with a registered name on, say a separate thread, or scheduled in the run loop, with a callback when a connection is made? Currently I am using [NSConnection…
Jared Pochtar
  • 4,925
  • 2
  • 29
  • 39
1
vote
0 answers

iOS: How to Set Connection Option on WiFi Only and WiFi with Mobile network,

Set connection type if selected wifi only when use only wifi, not use mobile network. if selected Wifi with Mobile connection when use both connection as per as available.
vipinsaini0
  • 541
  • 1
  • 7
  • 26
0
votes
1 answer

How to set NSMutableRequest timeout less than 240 seconds after setting body?

I'm creating NSMutableRequest and adding data to body. Heres example how I do it: NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:stringURL] …
Mindaugas
  • 137
  • 1
  • 7
0
votes
1 answer

upload image using objective-c

I'm writing an iPhone app for a web service and I need to upload image to the service. In the web version, it's using AJAX. But I know little about that. I find the following code on the web page for the upload button: if (button.length) { …
Eric Wong
  • 524
  • 9
  • 21
0
votes
1 answer

Multiple simultaneous NSConnections for web query

When using async download methods and delegates, is it possible to start multiple simultaneous nsconnections and handle them separately as each query completes? Or, will the system not automatically distinguish between them as your delegates receive…
johnbakers
  • 24,158
  • 24
  • 130
  • 258
0
votes
1 answer

How could connectionDidFinishLoading: run if no file is found on server?

Possible Duplicate: Testing use of NSURLConnection with HTTP response error statuses This is bizarre; I have an async connection like so: NSString *url=[NSString stringWithFormat:@"http://www.whatever.com/file"]; NSURL *url2=[NSURL…
johnbakers
  • 24,158
  • 24
  • 130
  • 258
0
votes
1 answer

How to authenticate NSConnection requests?

(Let's ignore the fact that NSConnection is now deprecated.) I have a tool that accepts connections to NSConnection over a service port. I have an application that launches the tool and then connects to it. That part works. Now, I like to make sure…
Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149
0
votes
1 answer

Creating NSDistantObject

I have two applications 'A' and 'B' and need to do some ipc. Process 'A' launches process 'B' if it is not already running. In process 'A' I create NSConnection and registerName:. In process 'B' , I get the remote object by calling…
Raviprakash
  • 2,410
  • 6
  • 34
  • 56
0
votes
3 answers

NSURLConnection send request after finish all process

I have a nested loop of sending the request. -(void) download { for(NSString *id in array) { //init with request and start the connection NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:…
user1151874
  • 269
  • 3
  • 5
  • 15
0
votes
1 answer

NSURLConnection cancellation callback

Is it possible to catch NSURLConnection cancel using a callback? If I'm using this code -(void) pleaseStopDownload { cancelled = YES; [conn cancel]; conn = nil; [self myUpdateUImessage]; } from time to myUpdateUImessage is called…
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
0
votes
1 answer

Error while making SOAP request call in iPhone app

I am trying to make a soap call. It's a very basic call with "Welcome User" output. The return value is in xml format, and I am getting the following error. However I am not sure what this error means. The following code shows the soap request and…
Jayshree
  • 281
  • 1
  • 6
  • 28
0
votes
0 answers

memory issue in NSConnection sendSynchronousRequest

i am trying to use LolayHttpClient in one of my iOS project. it works well except one issue - the memory keeps growing even i run the code under autoreleasepool. The related code is quite straight forward. LolayHttpClient use NSConnection…
Jack
  • 21
  • 5
0
votes
0 answers

-[NSApplication terminate:] misbehaves when employing an NSConnection

I have a two simple applications that use a NSConnection object for communication. Now I need to terminate one of the apps in a controlled fashion, so I call -[MyObj terminate] on the vended object of the NSConnection. This method in turn calls…
iolo
  • 1,090
  • 1
  • 9
  • 20