And implements the delegate methods, but it seems that those
methods are not called at all. I search the problem in stackOverflow for some time and find a blog(here) that helps me know and solve the issue. "If you are performing this on a background thread, the thread is
So I follow codes in that blog and modify code in my NSOperation object
to keep the runloop form exiting is to just put it in an infinite loop: - (void) start [NSURLRequest requestWithURL:download_.url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:15] delegate:self]; if (connection_ != nil) { [self willChangeValueForKey:@"isExecuting"]; executing_ = YES; [self didChangeValueForKey:@"isExecuting"]; } else { [self willChangeValueForKey:@"isExecuting"]; finished_ = YES; [self didChangeValueForKey:@"isExecuting"]; } while(!finished_) { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; } } { finished_ = YES; } [self didChangeValueForKey:@"isFinished"]; }
This works well now :)
------
My new business with my wife, wholesale meddle-to-high end men's seamless underwear in the Netherlands: https://ecosharelife.com
|
Senry currently is an iOS Developer living in Amsterdam, the Netherlands. If you got any questions plz feel free to contact me with mail or gtalk: senryxie@gmail.com Or if you got an QQ, mine is 63793476.
2012年8月9日星期四
Asynchronous NSURLConnection with NSOperation
When I work on NSURLConnection with NSOperation today, I alloc a NSURLConnection like this
2012年8月7日星期二
'libxml/xmlversion.h' file not found
In Xcode 4.2 and 4.3 when facing this error, you can do following setting to fix it.
In your build settings, for the key "Header Search Paths", add
------
My new business with my wife, wholesale meddle-to-high end men's seamless underwear in the Netherlands: https://ecosharelife.com
In your build settings, for the key "Header Search Paths", add
"$(SDK_DIR)"/usr/include/libxml2
------
My new business with my wife, wholesale meddle-to-high end men's seamless underwear in the Netherlands: https://ecosharelife.com
订阅:
博文 (Atom)