Questions tagged [nscondition]
20 questions
0
votes
1 answer
Core data concurrency: avoid writing at two seperate places
I am doing a little heavy core data insertion work (say A) just after login on a private context (to avoid main thread blockade).
Before this gets completed, unfortunately at some place in code there is also an insertion work (say B) (not heavy) but…

Firdous
- 4,624
- 13
- 41
- 80
0
votes
0 answers
NSCondition locked by invalid thread
I'm attempting to create a multithreaded transition animation system, but am confused by seemingly corrupted state in an NSCondition object I'm using for synchronization. I've added some lines from my debugger below to illustrate what's…

Kurt Horimoto
- 107
- 5
0
votes
1 answer
How to use NSCondition when there are two different places that signal & wait
Here's pseudo code of what I have in a method:
NSCondition condition = [[NSCondition alloc] init];
int predicate = 0;
dispatch_sync(dispatch_get_main_queue(), ^
{
[condition lock]; // Lock-0
});
bindBlock1ForDataReceived(^()
{
//…

meaning-matters
- 21,929
- 10
- 82
- 142
0
votes
2 answers
How to wait for asyn operation in iOS unit test using NSConditionLock
I have a unit test in which I need to wait for an async task to finish. I am trying to use NSConditionLock as it seems to be a pretty clean solution but I cannot get it to work.
Some test code:
- (void)testSuccess
{
loginLock = [[NSConditionLock…

lostintranslation
- 23,756
- 50
- 159
- 262
0
votes
1 answer
How to wait for a certain status of a NSURLConnection
Sorry to bother with yet another NSURLConnection question, adding to the over one thousand already here.
The scenario is as follows. In an iPhone app using dynamically loaded augmented reality features, the user is prompted to download new AR models…

Paul Buller
- 150
- 7