ios - Is it possible to dynamically extend an NSProgress hierarchy after progress has started? -
I have some hierarchy of My use case is that I have an application that can upload files to Remote Server. Users can select some files and press a button to begin uploading them. Although they are uploading the user sees the overall progress of uploads. Now, if the user wants to choose a few more photos to upload, then the upload is already in progress. I want to update the progress to show the new total. For example, he is currently uploading 2 files. , 1 has already been completed, while they are uploading, they should adjust the progress of 2 pairs more to upload Total Unit should now be 4 and upload Stay sector remaining 3 items. It seems that this would be a common use case for me. Here is a unit test that I have written with a Engineering has determined that this problem behaves based on the following information: The reason for this is that we can not update the full unit count of parents while children Any member of the 'group' of (those attached are the progress of a child, while a progress is present) is incomplete once in the group Will end all the members, we are able to isolate a group of parents and extended full unit calculates parents. It retains the correct account of the entire work. For this, there are accounts of localized description system, which is why it gives results differently from the full United Utility property. If you want to track more closely on the completion of these children, then you can turn on the parents more often, often with a small unit count, when children are completed If so, parents will update their full unit number more frequently. NSProgress objects for simplicity, say a basic progression with 2 children If progress has already begun, then can I add progress to another child in the hierarchy and hope to be right? For example, I start with 2 children, so the root is
totalUnitCount is
2 and
is a pending unit code
2 . Once the first child completes the root progression, '
fractionCompleted will be
0.5 . If I then add another child's progress then updates the ''
fractionCompleted to
~ 0.33 , but the root of the
totalUnitCount remains on is. > 2 , as
pending code does. I can manually update
totalUnitCount but it turns off the
fraction integer of the route, except without calling
There is no way to become. Currently designation unit number: . Was not designed for this type of use or is there a "proper" way of doing this?
NSProgress hierarchy expanding dynamically. All the tests given below have been stressed, but if you check the root of
totalUnitCount , then there is always 2 and it tells how many objects are being fulfilled by the root progression. The basic progression is the one which will follow the UI, so it is important to change the depth in the hierarchy,
totalUnitCount , etc.
with
- (zero) testDynamicNSProgress {NSProgress * root = [TotalUnitCount with NSProgress progress: 2]; [Root BondingWithPending Unit Number: 2]; NSProgress * child1 = [TotalUnitCount with NSProgress progress: 1]; NSProgress * child2 = [TotalUnitCount with NSProgress progress: 1]; XCTAssertEqual (root.totalUnitCount, 2); XCTAssertEqual (root.completedUnitCount, 0); Child1.completedUnitCount ++; XCTAssertEqual (Seat (RouteFrogress Group * 100), 50); NSProgress * child3 = [TotalUnitCount with NSProgress progress: 1]; NSProgress * child4 = [TotalUnitCount with NSProgress progress: 1]; XCTAssertEqual (Seat (Route Freshener * 100 *, 25); Child2.completedUnitCount ++; XCTAssertEqual (Seat (RouteFrogress Group * 100), 50); Child3.completedUnitCount ++; XCTAssertEqual (Seat (Route for Fertility * 100), 75); Child4.completedUnitCount ++; XCTAssertEqual (Seat (RouteFranceExtra * 100), 100); __unused NSProgress * child5 = [TotalUnitCount with NSProgress progress: 1]; XCTAssertEqual (seat (routed for full * 100), 80); } I filed a bug with the apple and it was his reaction:
Comments
Post a Comment