Appz Venture
Appz Venture

Reputation: 939

How to do Multithreading in ios3.2 some issues arises

I have question that i am using ios 3.2 for iPad .. Its working on the iphone 4.1 but its not working on iPad ios 3.2

here is my code:

dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
    dispatch_async(queue, ^{
        dispatch_sync(dispatch_get_main_queue(), ^{
            [self myPrivateFunction];
        });
    });

Please tell me what can i do it for that..

Upvotes: 0

Views: 109

Answers (3)

cli_hlt
cli_hlt

Reputation: 7164

Well if you had taken the time to look into the docs, you would have seen that Grand Central Dispatch has been introduced to iOS with Version 4.0. So there is no way they will work on iOS Version 3.2.

Alternatives: Use some of the async methods like performSelectorInBackground:withObject: or roll out your own threading methods with pthreads.

Upvotes: 1

jamihash
jamihash

Reputation: 1900

Grand central dispatch is not available before iOS 4.0. You can use NSInvocationOperation for async operation.

Upvotes: 0

omz
omz

Reputation: 53551

GCD and blocks aren't available in iOS 3.2. For simple multi-threading, you can use performSelectorInBackground:withObject: and performSelectorOnMainThread:withObject:waitUntilDone: instead.

Upvotes: 0

Related Questions