nsoperationqueue

Persisting items being uploaded via web service to disk

I have a launchd daemon that every so often uploads some data via a web service using NSOperationQueue. I need to be able to persist this data, both so that it can later be re-uploaded in the event of failure, even between sessions (in case of computer shut down, for example). This is not a high load application, it probably receives i...

NSURLDownload delegate methods on a separate thread

Hey, Is anyone aware of a way to receive NSURLDownload's delegate methods on a separate thread, i.e. not the main one? I am using an NSOperationQueue to manage them but at the moment I need to use the performSelectorOnMainThread method to get it too work. The problem with this is that it drives the kernel task crazy reaching about 30% o...

Queue of NSOperations and handling application exit

Hi there, I'm about to create a series of NSOperations and run them in a queue. They will all be sequential and run one at a time. These operations will fetch data from the web and create and save core data managed objects. How do I handle the situation where the application exits? As the operations run in detached threads, how can I...

Asynchronous methods in NSOperation

Hi there, I'm fetching some data from Facebook Connect (using the FBConnect Objective-C 2.0 framework) and I'm doing all that in an NSOperation. It is in an NSOperation because I have several other operations that run as well and this is one of them. The problem is that all the FBConnect calls are asynchronous. Because of this, the mai...

Do Operation Queues help out when Core Animation strikes to animate?

Core Animation uses Background Threads. When performing heavy calculations on the main thread, CA stops animating due to its low priority threads. How could Operation Queues help out in such an situation? ...

NSOperation will not cancel NSXMLParser. Which continues to call methods on delegate causing crash

I am trying to download some XML on another thread, and parse it. I release the 'controller' then call cancelAllOperations on the NSOperationQueue. And implement method 'cancel' on NSoperation which attempts to set nSXMLParser's delegate to nil. But a second or so later the NSXMLParser is still alive and kicking and calls methods on i...

Fetching Core Data in the background

Hello All, I have a Navigation View with a Table View, when a row is clicked, the row indexPath is passed to the next view. in the Details view viewDidLoad, i am fetching data from Core Data. i use the fetching from the application delegate [appDelegate loadItem:i]; As you can see i am passing one integer only which carries the row nu...

How can we pause adding annotations while MKMapView is animating or moving. [iPhone SDK 3]

I have a MKMapView and another class has a thread adding annotations to the MKMapView. But the problem is, MKMapView.annotations is nonatomic. So while the other class is adding annotations.... It looks OK if user do not move the map's visible area. But if you keep moving it, and the other class was adding annotations to the map at tha...

While switching view on navigation bar, how to quit NSOpreationQueue thread safely without EXC_BAD_ACCESS error.

I am using an UITableView to show some string messages, and I use NSOperationQueue to hold an customized NSOperation which fetchs message in background thread. After one message fetched successfully, customized NSOperation will notify the UITableView controller to show it. If I click back button on the navigation bar to switch from the ...

OpenFlow :: Howto Stream Images

I am trying to use OpenFlow (http://apparentlogic.com/openflow/) in an iPhone App to stream files off of my server. How can I do this? Should I be using NSOperationQueue? So far I have been able to: * Use local files * Use their demo from Flickr (which uses the Flickr API and library) Code to load local images: NSString *imageName; f...

NSOperation blocks UI painting?

Hi, I'm after some advice on the use of NSOperation and drawing: I have a main thread create my NSOperation subclass, which then adds it to an NSOperationQueue. My NSOperation does some heavy processing, it is intended to loop in its main() method for several minutes, constantly processing some work, but for now I just have a while() ...

ASIHTTPRequest swallows up my NSOperation variables in synchronous mode

Hey I have been battling with this problem for a while now. Perhaps there is something I am missing in knowledge about multi threading but here is what happens. When I create an nsoperation queue any variables that are allocated become cleared after the "[request startSynchronous];" line of code. Here is what I'm talking about: @impleme...

Does Multiple NSURLConnection make delay of performance?

Hi all~. I made a multi files downloader. I implemented NSURLConnection using NSOperationQueue. NSOpetationQueue has many NSURLConnection operations. and, set MaxConcurrentOperationCount to 10. I thought my code is right, But after run the project, it was wrong. there are some connection error has occured. files url were right. and f...

I get EXC_BAD_ACCESS when MaxConcurrentOperationCount > 1

Hello i am using NSOperationQueue to download images in the background. I have created a custom NSOperation to download the images. I put the images in table cells. The problem is if I do [operationQueue setMaxConcurrentOperationCount: 10] and i scroll down several cells the program crashes with EXC_BAD_ACCESS. Every time it crashes at t...

Multiple NSOperationQueues?

Hello! I would like to use NSOperations in my application to resolve threading problems. I have read some tutorials and now I know what I have to do, but I have a problem. There is a must to have the same NSOperationQueue in each class. What if I use a new NSOperationQueue in each class. There will be concurrency problems? ...

NSoperation and key value observing

Hello guys! I am creating a MyOperation object (inherited from NSOperation) and add to a NSOperationQueue. Then I am doing KVO on MyOperation. I am using this method - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context; to get a value from MyOperation if it is fi...

NSOperation unable to load data on the TableView

I have a problem in NSOperation. I tried many ways but it would run behind the screen, but will not make it appear on the my table view. Can anyone help me out with this. I am new to NSOperation. Recents.h #import <UIKit/UIKit.h> #import "FlickrFetcher.h" @interface Recents : UITableViewController { FlickrFetcher *fetcher; NSString ...

Core Data blocking UI after asynchronous NSURLConnection didLoadResource on iPhone

Each time somebody touches a row inside a UITableView, I'm kicking off a series of asynchronous NSURLConnections, that download data and then parse and save that data into Core Data. The problem is that when I do this, the UI is responsive during the data download, but as soon as the parsing and saving begins, the UI becomes non-respons...

iPhone: NSOperationQueue running operations serially

I have a singleton NSOperationQueue that handles all of my network requests. I'm noticing, however, that when I have one particularly long operation running (this particular operation takes at least 25 seconds), my other operations don't run until it completes. maxConcurrentOperationCount is set to NSOperationQueueDefaultMaxConcurrentOp...

NSInvocationOperation and main thread

Imagine that I have a view with some UIKit object as its subview (for example, UIActivityIndicatorView - this doesn't matter). This view also has a selector, called doSomething, which somehow manages UIKit object (in our example it can start or stop indicator view). I create NSInvocationOperation (from view's code parts) with initWithTa...