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

UIPickerView "preemptive" messages?

I have a situation where my UIPickerView is getting "starved" by a computation task; in other words, the UIPickerView is never updated -- and hence, never sends messages -- because a very heavy compute task is happening. The picker controls…
Anna Dickinson
  • 3,307
  • 24
  • 43
0
votes
2 answers

Cancel NSTimer in NSRunLoop

I'm currently doing this: timer = [NSTimer timerWithTimeInterval:timeUntilAction target:self selector:@selector(actionToPerform) userInfo:nil repeats:NO]; NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; [runLoop addTimer:timer…
RileyE
  • 10,874
  • 13
  • 63
  • 106
0
votes
1 answer

NSThread with delegate for SimplePing

I'm currently using Apple's SimplePing in a Mac OS X application to ping a URL before transferring data, which works fine, but locks up my UI. I may not have looked in the right places, but how do I keep this from happening? I'm currently using…
Katie
  • 253
  • 1
  • 3
  • 13
0
votes
1 answer

NSTimer: is invalidate called when it is released?

I have a class which has an NSTimer, when I release it, does invalidate also called? Or can I do them both in dealloc: - (void)dealloc { [_timer invalidate]; [_timer release]; [super dealloc]; } I read in this thread: invalidate method…
hzxu
  • 5,753
  • 11
  • 60
  • 95
0
votes
2 answers

NSTimer animation while main thread is drawing

I've read a million posts on stackoverflow about nstimers, runloops and the main thread but they don't seem to have the same problem or answer I'm looking for. My situation: I'm trying to animate some stuff while there is some 'loading going on'.…
Bob de Graaf
  • 2,630
  • 1
  • 25
  • 43
-1
votes
1 answer

Calling -[NSRunLoop runMode:beforeDate:] on main thread causes queued NSOperations to run on main thread

I ran into an issue today where my app was failing to start in time. It turns out some third-party code I was using was trying to get the user agent string using the trick below: -(NSString*)userAgentString { webView = [[UIWebView alloc] init]; …
Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
-1
votes
1 answer

Why does this Timer/RunLoop code work? It shouldn’t

class A: Timer { var myTimer: Timer! } class TimerTestViewController: UIViewController { var a = A() override func viewDidLoad() { super.viewDidLoad() a.myTimer = Timer.scheduledTimer(timeInterval: 1, target: self,…
Jay
  • 267
  • 2
  • 7
-1
votes
1 answer

runMode:beforeDate: running forever

I might be misunderstanding what the function runMode:beforeDate: does but why does this seem to run forever (at least beyond the 10 seconds set). NSRunLoop *theRL = [NSRunLoop currentRunLoop]; NSDate *date = [NSDate…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
1 2 3
23
24