NSProgress: is there really no API to find its children?
NSProgress: is there really no API to find its children?
- Subject: NSProgress: is there really no API to find its children?
- From: Jens Alfke <email@hidden>
- Date: Thu, 09 Apr 2015 08:46:00 -0700
I just started using NSProgress. I’m going to use it as the mechanism for my framework to report the progress of a complex upload/download operation which can involve many files and other HTTP resources: the object representing this operation will have a public “progress” property exposing an NSProgress that the app can observe.
I like the way NSProgress is hierarchical, so a top-level instance can have child instances for sub-tasks. I’m making use of this to aggregate the progress of multiple download operations into one progress value. But I can’t find any public API for getting the nested NSProgress instances, i.e. something like “@property (readonly) NSArray* children". Huh? Did I miss something, or is this just some inexplicable hole in the API?
(I can tell each NSProgress _knows_ what its children are — it lists them in the output of its -description method, in a very nice tree display.)
Assuming this isn’t possible, are there any best practices for working around this? I’m considering defining a custom userInfo property, in which I can store an NSArray of the children.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden