Questions tagged [nsprogress]

NSProgress is an API for tracking progress introduced in OS X 10.9 and iOS 7.1.

See the NSProgress Class Reference for details. There are also useful notes on NSProgress in the Foundation Release Notes.

31 questions
2
votes
1 answer

iOS 8 - NSProgress object with fractionCompleted = 1.0 created by NSURLSessionDownloadTask before even resuming the task

I have a tree of NSProgress objects to monitor data processing which involves downloading files. Downloading is done using NSURLSession with background configuration. When I start the process, the topmost NSProgress object reports unexpected…
rgal75
  • 151
  • 6
2
votes
0 answers

Tree of NSProgress without prior knowledge of the "size" of the children

I am sure this has already occured to someone but I could not find a trusted source (on Stackoverflow or elsewhere) to solve this. I have to download a (finite) number of files. I don't know their size prior to downloading them. Their size can…
Jonas Schmid
  • 5,360
  • 6
  • 38
  • 60
1
vote
0 answers

How to show progress for `NSExtensionRequestHandling` on macOS for Finder?

Writing a Finder extension / Quick Action (see https://developer.apple.com/documentation/appkit/app_extensions/add_functionality_to_finder_with_action_extensions) I happen to have a long-running operation showing "Estimate time remaining...". I am…
Holtwick
  • 1,849
  • 23
  • 29
1
vote
0 answers

How do I get the number of bytes written during a copy/move process using FileManager?

I want to show a progress indicator when conducting FileManager tasks such as moveItem and/or copyItem calls. Can Progress be used to monitor FileManager's progress? If so, can someone give me some guidance on how to do that? Maybe a short…
SouthernYankee65
  • 1,129
  • 10
  • 22
1
vote
2 answers

How to use/test NSProgress userInfo changes of a child NSProgress instance

I'm implementing NSProgress support in a library, and I wrote some unit tests to test that everything's working correctly. While ideally I'd like to be able to pass some additional metadata (userInfo keys not used by NSProgress itself, but for users…
Dov
  • 15,530
  • 13
  • 76
  • 177
1
vote
1 answer

Update NSProgress display from within ViewController Function Loop

I'm back again Hive Mind! In my ViewController class, I have a function which iterates through a series of items in an array. What I would like to happen is to have my progress bar update on each iteration of the loop, but it appears that it…
Greg Steiner
  • 647
  • 1
  • 9
  • 20
1
vote
2 answers

NSProgress::completedUnitCount setter hangs

(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didSendBodyData:(int64_t)bytesSent totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend { self.progress.completedUnitCount…
Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66
1
vote
0 answers

NSProgress not updating its totalUnitCount and completedUnitCount

I am trying to report the download of a son file from a server to the requester through an instance of NSProgress. However, when I set the totalUnitCount and completedUnitCount values, these are simply not updating on the NSProgress object. This is…
Michael Ochs
  • 2,846
  • 3
  • 27
  • 33
1
vote
0 answers

Trying to cancel on Asynchronous Fetch with NSProgress using Core Data in iOS 8

I am working on iOS application using Core Data where I am fetching results from Core Data asynchronously. I need to figure out a way to implement a cancellation function of this fetch in case the user decides that they have been waiting too long,…
syedfa
  • 2,801
  • 1
  • 41
  • 74
1
vote
1 answer

How to add property observer to NSProgress in swift?

I want to add property observer to NSProgress. I have this code, but it calls only one time. var progress: NSProgress? { didSet { println(progress!.fractionCompleted) } }
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86
1
vote
1 answer

Download file with AFNetworking in swift

I want to download file from URL using AFNetworking in swift, and show downloading progress. I have this code, but it doesn't work: func downloadPdf() { var request = NSURLRequest(URL: NSURL(string: "http://www.sa.is/media/1039/example.pdf")) …
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86
0
votes
0 answers

NSProgress not working with sandboxed items?

I'm creating an NSProgress object to show a progress indicator underneat a file in my Downloads directory. The entitlements includes com.apple.security.files.downloads.read-write. The indicator does not show when NSProgressFileURLKey points to the…
mdbraber
  • 1
  • 1
0
votes
1 answer

Firebase Upload images | make use of NSProgress

I have to upload 3 Images to Firebase. I'd like to monitor the upload progress of all three images via NSProgress. let currentUploadTask:StorageUploadTask = uploadPath.putData(data, metadata: nil) { (storageMetaData, error) in if…
mufumade
  • 400
  • 4
  • 16
0
votes
1 answer

How to use observeValueForKeyPath for several NSProgress?

I have implemented file sending functionality for connected peers from loop using multiplier connectivity. That code as follows. for connectedPeer in self.connectedPeers { let sendingProgress = self.session.sendResourceAtURL(newPhotoUrl!,…
hmlasnk
  • 1,160
  • 1
  • 14
  • 33
0
votes
1 answer

NSProgress when to remove the observer

NSProgress is a useful class for tracking progress across queues. It relies on observing the "fractionCompleted" property. But when/how are you supposed to remove the observer? I tried dispatch_group and dispatch_barrier but the observer is still…
user965972
  • 2,489
  • 2
  • 23
  • 39