Questions tagged [nsrunloop]

NSRunLoop is a class in Apple's Foundation framework. It processes inputs such as user events, network activity, and NSTimer events.

NSRunLoop is a class in Apple's Foundation framework for OS X and iOS. It processes inputs such as user events, network activity, and NSTimer events. Each NSThread object automatically receives its own NSRunLoop; apps cannot explicitly create or manage NSRunLoop objects.

353 questions
0
votes
1 answer

unable to forcefully cancel ftp download

I am using SimpleFTPSample to download and upload from FTP server. I have to cancel download after specific time regardless of completion and start uploading. But If I cancel the download and then start upload delegate method stream:handleEvent: is…
user1101733
  • 258
  • 2
  • 14
0
votes
2 answers

Correct way to add a timer to NSRunLoop

I'm trying to add timers to a NSRunLoop. My expected outcome is that once the timers have been added to the loop, they start counting down independent from one another. My code now looks like this: var timer = NSTimer() let…
martin
  • 1,894
  • 4
  • 37
  • 69
0
votes
1 answer

How to send Socket Messages in Series with Obj-c

I am currently using CocoaAsyncSocket to send UDP Socket messages to a server. Occasionally I need to enforce that messages arrive in a specific order. Basically my code structure is similar to below. NSMutableArray *msgs = @[@0, @1,…
Sean Dunford
  • 938
  • 1
  • 9
  • 24
0
votes
1 answer

How to load page content within a new UIWebView before exiting current method

I have an application with implemented local server which handles request from web front-end. UIWebView presents some GUI, user do some interaction, I handle his requests and send responses back to webview. Sometimes I'm receiving some request which…
objc3p0
  • 1
  • 1
0
votes
1 answer

NSMetadataQuery’s update notification interferes with (run loop?)

I emailed an Apple engineer last week about a problem with my NSMetadataQuery. Here’s the email: Hi, I'm writing a document-based app or iOS and my method for renaming (moving the document to a new location) seems to conflict with the running…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
0 answers

UIEvent detection and handling

My app has many threads, so I do get lot of crashes when the same variable is updated and read at the same time. To solve this issue I decided to use NSLock and lock it when the variables are updated and similarly lock it when I get an event Ex:…
Agarathi
  • 148
  • 1
  • 14
0
votes
2 answers

NSThread waking up

I would like to know how I can achieve the following in objective-c, I am doing communication with FTDI232R modem using serial communication,So I am using POSIX call to open,write and read from the path of the modem(dev/tty/nameOfModem). The POSIX…
subhash Amale
  • 325
  • 3
  • 4
  • 14
0
votes
1 answer

Scheduled NSTimer's selector called with delay in iOS

I have an NSTimer that should be running all the time the app is active. It is intended to show a countdown that depends on certain user's actions. I fire this timer this way: self.timer = [NSTimer scheduledTimerWithTimeInterval:1 …
AppsDev
  • 12,319
  • 23
  • 93
  • 186
0
votes
1 answer

Run Loop to set color to button ios?

I've got sort of a problem with my ios application. It handles the Apple Push Notification (APN) and everything BUT, my app handle it in it appDelegate.m The problem is I want to make a button to change color if the user have a notification, so I…
Jeromiin
  • 71
  • 7
0
votes
2 answers

Can't schedule NSStream on currentRunLoop only MainRunLoop

I am trying to use a NSInputStream inside a concurrent NSOperation. I noticed that I can not schedule it on the current run loop, only the main run loop. Why is this? Do I need to create my own run loop for the thread the NSOperation is on? Here is…
user1028028
  • 6,323
  • 9
  • 34
  • 59
0
votes
1 answer

NSURLConnection, NSOperation and NSRunLoop confusion over threading

I got confused while working with NSURLConnection and NSRunLoop. I’m trying to download a large file using NSURLConnection but it’s NOT working (Not even calling a single delegate method) as expected. NSURL *url = [NSURL…
Zeeshan
  • 586
  • 7
  • 15
0
votes
2 answers

NSTimer choppy when pressing buttons the second time a view loads

I'm creating a game view controller using an NSTimer to update a progress bar representing the remaining time of the current game round. This game view also displays a button performing some light core data updates. When the remaining time is up,…
pepollet
  • 1
  • 3
0
votes
1 answer

NSRunLoop makes app non-responsive sometimes

In my app, I need to make https calls to a restful web api and process the results upon return. The number of simultaneous service calls is never fixed, hence the related code has been written accordingly. The data fetched from the service is…
0
votes
1 answer

NSRunLoop issues with NSURLConnection and Keyboard input

I have a NSURLConnection which carries out the task of uploading images for me. This is how I initialize and start this connection: _connection = [[NSURLConnection alloc] initWithRequest:request delegate:self …
Mepla
  • 438
  • 4
  • 16
0
votes
2 answers

ios multiple NSStream handlers

am new to ios programming. my app is linking with a library that opens NSStream and uses them as below: [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [outputStream…
user3282227
  • 131
  • 2
  • 10