Newsstand Download Queue Management - iphone

Can u please let me knw what is the status of the NKIssue when it is added in the queue waiting for download to start??
Out of these 3 :
NKIssueContentStatusAvailable
NKIssueContentStatusDownloading
NKIssueContentStatusNone.
I'm getting NKIssueContentStatusDownloading Status even for the queued Issues.

The Apple documentation says the following in the overview of the NewsstandKit object NKLibrary:
The downloadingAssets array holds any downloading assets for any issues. (A downloading asset is represented by a NKAssetDownload object.) A newsstand content application should, when it launches, iterate through this array and call downloadWithDelegate: on each item to have the downloaded assets completely processed.
I am using deductive reasoning to assume that once a NKIssue has had it's downloadWithDelegate: method called it keeps the status NKIssueContentStatusDownloading until it has been removed from the NKLibrary or downloaded.
Also, if a download has been interrupted and needs to be resumed, you would loop through all the NKIssues in NKLibrary's downloadingAssets property to re-call it's downloadWithDelegate to resume it. However, who knows when the downloadingAssets is cleared or reset. I don't even know where we would find that out.
That's the best answer I could find.

Related

Unity Addressables, make content update skippable

For my application I have a couple of really large bundles and I want the user to be able to skip (specific) updates to the content.
At the moment I'm using the Addressables.CheckForCatalogUpdates() which lets me know If there's an update.
But using this function already lets my application know there's a new version of the assets and as soon as I load the asset it wants to use the new (still to download) version.
Ideally would like to end up with a flow similar to:
Application checks for updates
User gets prompted if he/she updates
=> User updates
New content is downloaded
=> User skips updates
content is loaded from cache
Application continues
Help is much appreciated!
Regards,
Gijs

Stop Firebase downloading task returned by GetFileAsync in Unity3D

I met a case when I need to stop already started downloading task using GetFileAsync method. Unfortunately I didn't find any info about it and how to implement it in Unity3D (c#).
I know there is a way to stop thread, but don't see the way to find thread by that task.
The idea is to stop downloading in some cases, for example if user change the scene and downloading content is not actual anymore.
Please, advice, is there a solution to implement it?
Given that the download methods all return a C# Task, which doesn't contain a pause or similar method, I don't think there's a way to do this at present.

UIPasteboard is stubbornly persistent, no matter what I do

I am creating a application UIPasteboard with my app's identifier as a name (e.g. com.example.app.pboard) as suggested in the docs.
All the copying and pasting works, but the damn thing never goes away. I set its persistent property explicitly to NO every time I access it to copy something onto it, and I even call UIPasteboard's +removePasteboardWithName: every time my app starts.
But every time I look at it, the most recent thing I copied onto it is always there, despite app restarts.
What gives?
No idea why what you are trying isn't working, here are two guesses and a possible solution:
Removing the paste board may be expected to be executed on exit from the app, so it doesn't execute until the app is terminated or backgrounded?
Calling remove and then asking for the items may be recreating it again in the same "place" so the items still remain.
You could perhaps solve this by setting the pasteboard's items to nil when leaving or entering the app.
You can set UIPasteboard to persistent. Accord to Apple's document,
setPersistent:
A Boolean value that indicates whether the pasteboard is persistent.
When a pasteboard is persistent, it continues to exist past app terminations and across system reboots. App pasteboards that are not persistent only last until the owning (creating) app quits. The system wide general pasteboard is persistent. Named, app-specific pasteboards are not persistent.
Update: For iOS 10, UIPasteboard set persistence automatically.
Note
Starting in iOS 10, the system sets pasteboard persistence automatically. If you try to set the setPersistent: property on a pasteboard, Xcode issues a deprecation warning.
Instead of named persistent pasteboards, use shared containers, as described in the Overview section of this document.

Debugging SIGABRT within NSManagedObjectContext -save:

From inside NSManagedObjectContext -save: I am getting this message:
Assertion failed: (_Unwind_SjLj_Resume() can't return), function _Unwind_SjLj_Resume, file /SourceCache/libunwind/libunwind-24.1/src/Unwind-sjlj.c, line 326.
Program received signal: “SIGABRT”.
warning: Unable to read symbols for
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1
(8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib
(file not found).
This happens when I delete an Experiment object with to-many with Run which has to-many with Sample which has to-one with Data. Experiment also has to-many with Page which has to-many with Display which has to-many to Run. I mention this to point out the cyclical nature of the graph. Here is a simplified graph of model:
An Experiment a top level entity with which the user interacts. An Experiment contains multiple Run objects. A Run is a collection of data starting at a particular time and ending at a later time. Since data can be collected from multiple sources simultaneously, there is a Sample for each source for each Run. An Experiment contains data and this data needs to be viewed and interacted with. So, each Experiment has some number of Page objects and each Page contains some number of Displays (e.g., graphs, meters). A Display is configured to display some subset of the Runs that belong to the Experiment. So, while an Experiment may contains dozens of Runs, one of its Pages will only display a few of those Runs at a time. The Display entity maintains this list. A Display is not a view. A view will reference a Display object and be notified of changes to the Display object.
I had been using Delete Rules but have now switched to "No Action" delete rules in combination with -prepareForDeletion methods for all of these classes. This change made no difference. In both cases, the error message is the same.
Interestingly, when I relaunch the app, all the objects that were marked for deletion have been deleted.
Also, if an Experiment has no Run objects, then deletion works without incidence. For that matter, deleting a single Run from an Experiment also works.
I am hoping that someone has seen something like this and can offer advice on what would cause this. Or, if someone has advice on how to get libXcodeDebuggerSupport.dylib for iOS 4.2.1, that might also be helpful.
Update: I followed advice found here and was able to get Xcode to find libXcodeDebuggerSupport.dylib for iOS 4.2.1. But this did not help at all in diagnosing problem - which persists.
Update 2: After reading a bit and downloading a version of unwind-sjlj.c, it seems that I am dealing with something like an uncaught exception. I am not sure how this helps me...
Update 3: Thanks to Kamchatka, I did something I probably should have done a few days ago: turned on "Stop on Objective-C Exceptions". This allowed me to see that a reference to a deleted object was still being held - and, worse, was key-value observing the deleted object. Fixing this fixed problem and I was able to revert to using delete rules rather than -prepareForDeletion methods.
You should try to activate "Run > Stop on Objective-C exception". It allowed me to find the place where there was an access to an object turned into fault which was the root cause of the problem.

How to empty cache for WebView?

I have a Webview that must load an image! When I upload this image I see every time the same image as before, and i must reboot my app to see the new image...
I think is a cache problem..How can I solve that??
One quick and easy method would be to append the current time stamp onto the url whenever you load it.
So instead of loading:
http://www.myhost.com/myimg.jpg
you'd load
http://www.myhost.com/myimg.jpg?12345689
Using a cache breaker like this is a very common method in web development to force reloading of content.
I did do some quick googling and it appears clearing out NSURL's cache won't do the trick. In 10.6 the api reloadFromOrigin: may do the trick, but I'm not aware if this has made it's way onto the iphone yet.
Edit:
I found this page in the docs. It looks like you can use the preferences system to say whether or not to use caching. Not tested, but that'd be something to look at.