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

Method call in a particular time interval till the application is in device

Basically I need to create a Beacon for my application to send the packet to my server in every 15 min till my application is in my device. I need to send in every state of my application bather about the application is in frontend or back end.…
Myaaoonn
  • 1,001
  • 12
  • 25
0
votes
3 answers

NSTimer to fire while device is locked

I'm currently creating an alarm. I use NSTimer to schedule my alarms. My problem is when the device was put into locked mode my NSTimer doesn't fire. I think that the NSTimer will not fire because my app goes to suspended state when it is lock. Can…
edie
  • 758
  • 1
  • 11
  • 29
0
votes
1 answer

How to jump to a specific breakpoint when I press the pause button in Xcode debug area?

I used to find a debug technique in an article, but I forget how to do it now. I describe it below and hope someone knows. I remember that we can write some code anywhere such as in a ViewController's viewDidLoad. override func viewDidLoad() { …
LinShiwei
  • 1,042
  • 14
  • 17
0
votes
1 answer

NSFileHandle behaving strangely when run without debugger - some NSRunLoop issue?

I'm writing a plugin for Adobe Premiere on Mac, which opens an external application and then uses NSPipe and NSFileHandle to read the standard output from the external application. I know the recommended ways to do this involve either using…
Thomas
  • 485
  • 4
  • 15
0
votes
1 answer

Synchronize AudioUnit callback with NSOutputStream

I'm recording audio using an Audio Unit, then writing that data into an NSOutputStream which is part of a bound pair that I'm using to POST that data over HTTP. My problem is the audio unit recording callback and the NSOutputStream hasSpaceAvailable…
Roshan Krishnan
  • 187
  • 1
  • 3
  • 13
0
votes
1 answer

Equivalent of NSRunLoop under linux (Raspberry Pi)?

OS X has the NSRunLoop which just sits around waiting for timers and sources to fire. Then Apple switch to Grand Central Dispatch (GCD) where you have dispatch_main() to keep the app alive and a bunch of dispatch_source_'s to schedule stuff or to…
user965972
  • 2,489
  • 2
  • 23
  • 39
0
votes
1 answer

NSTimer update interval changes when app goes to background in iOS app?

I was recording a sample of CMDeviceMotion acceleration data for 30 seconds through NSTimer. The thing is, when the app is in foreground, everything is fine. The interval is set to 0.01 and in 30 seconds, 3000 readings are stored. But when app goes…
nr5
  • 4,228
  • 8
  • 42
  • 82
0
votes
2 answers

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'can't start iterating in the middle of an iteration'

I have source code as following: + (NSDictionary *)incrementalUpdateTask { __block NSDictionary *result = nil; __block BOOL isFinish = NO; [EQPlatformManager getIncrementTaskWithSuccess:^(NSArray *deletedList, NSArray *updateList) { …
Emalwb
  • 1
  • 1
0
votes
2 answers

Swift 3, make timer, add to dictionary, never goes off

I have Thing and ThingManager If no one mentions a specific Thing for a while, I want ThingManager to forget about it. let manager = ThingManager() let thing1 = Thing(name: "thing1") manager.addThing(thing1) manager.sawSomeThing(named:…
snakeoil
  • 497
  • 4
  • 12
0
votes
1 answer

NSThread detachNewThreadSelector???? uh?

I was looking through the Threading Programming which I have to say it's really good. Specially I was looking on How to configure Port-based input sources for running loops. And I see this piece of code // Detach the thread. Let the worker release…
gvalero87
  • 855
  • 3
  • 15
  • 32
0
votes
1 answer

NSRunLoop freezes app on iPad Pro under iOS10

I got a synchronous request inside a custom operation that looks like this: NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession* session = [NSURLSession…
0
votes
2 answers

Runloop works on simulator fails on device

I have an iPod Touch 2nd generation and I'm trying to retrieve a photo from the assets library by using the photo name. I ran restore on the device to make sure it is factory 4.1. My header file has: #import { …
user478150
  • 11
  • 1
0
votes
0 answers

NSMachPort how to get the components

So, I have an iOS 9 App that starts a NSOperation extended class and that class' main method it executes a NSRunLoop. I also have implement handleMessage successfully, that is, when I send some parameters to the NSMachPort, it kind of works... This…
geekyaleks
  • 1,281
  • 3
  • 18
  • 29
0
votes
1 answer

Behave of nested CATransaction?

The code below will update the backgroundColor immediately after the commit. [CATransaction begin]; self.view.backgroundColor = [UIColor redColor]; [CATransaction commit]; sleep(5); But with nested explicit CATransactions, screen update only when…
Karl
  • 665
  • 4
  • 19
0
votes
2 answers

Update UITableview cell with new loaded content while scrolling

I have a UITableView, I use the cellForRowAtIndexPath: function to download an image for a specific cell. The image download is performed asynchronously and finishes after a short amount of time and calls a completion block after finishing. I set…