Answer by Martin Lockett for Reordering UITableView sections on the iPhone by dragging (like reordering rows)

Maybe not ideal but fairly simple so worth considering: Add Up/Down buttons to your section headers. Down on the first, Up on the last and Up and Down on all the others. The respond to the button presses by programmatically re-ordering the table. Up moves the section up one and Down moves the section down one. Martin

Comments Off

Comment by Martin Lockett on What happened after NKIssue download terminated due to network unavailability?

Yes, that is the delegate callback method. I will reword the theory I have described above to be clearer and to answer these questions.
Comments Off

Answer by Martin Lockett for What happened after NKIssue download terminated due to network unavailability?

I have two theories if you want to investigate further and have no better ideas:

  1. I am surprised NSURLConnection calls didFailWithError. I would have expected the downloading asset to stay in downloadingAssets and be automatically retried later. My theory on this is: The didFailWithError method is optional and Newsstand Kit behaves differently depending on whether you implement this method or not. NSURLConnection may check that the delegate responds to the method to make this decision. If you implement the method and there is a network error, the error is reported using the didFailWithError method. After that method has finished executing, the downloading asset will be removed from the library. If you don't implement the method the download will not fail and any errors will be handled by the Newsstand Kit: the downloading asset will remain in the queue and will be retried indefinitely (as far as your software is concerned the download will never fail).

  2. If a download fails (or completes) you are informed by the didFailWithError (or the connectionDidFinishDownloading) delegate callback method. The downloading asset will probably not be removed from downloadingAssets until after that method has finished. If you present an alert during the method, the asset will not be there when the user presses the Download button again.

Comments Off

Comment by Martin Lockett on NKAssetDownload destinationURL does not exist as file or directory

Did either of the solutions below solve the problem or did you find a solution (or did you give up)?
Comments Off

Answer by Martin Lockett for Apple Newsstand Download Complete Notification

If you start downloading while the app is running and then terminate the app you won't get any asset download delegate methods called (there is a launch option UIApplicationLaunchOptionsNewsstandDownloadsKey which I expected in this case but I've never seen this happen). The best solution is when the user starts the app, resume downloading each of the assets in [[NKLibrary sharedLibrary] downloadingAssets] and you should get a connectionDidFinishDownloading for each that has already downloaded. Be sure to do this in the didFinishLaunchingWithOptions method on the main thread or the assets will be deleted.

Also see Detecting background app launch in Xcode to debug a Newsstand app and Newsstand resume download after the App closed by user Fully

Comments Off

Comment by Martin Lockett on IB plug in for CALayer subclass

FYI, I implemented a solution using IB after all. I use UIViews with custom classes, layout each level in a different NIB using the custom classes then at run time, I load the NIB for the required level and extract position and other information (e.g. hierarchy) from the views, then create CALayers to match the views in the NIB
Comments Off

Comment by Martin Lockett on Detecting background app launch in Xcode to debug a Newsstand app

There are two scenarios I can think of: 1 The user initiates a download of a previously purchased, downloaded and then archived product; then terminates the app. 2: A push notification initiates a background download and during this download, the user uses the app and then terminates it. As there is a UIApplicationLaunchOptionsNewsstandDownloadsKey which is used to launch the app I assumed it indicated that the specified assets have been downloaded and need attention. If not, what is it for? As you have now explained that this will not happen I'll take that as a solution to my problem.
Comments Off

Comment by Martin Lockett on Detecting background app launch in Xcode to debug a Newsstand app

No. I want to capture the app launching when a download has completed. However, I can't see why the wait for launch would work for notifications (UIApplicationLaunchOptionsRemoteNotificationKey) but not for UIApplicationLaunchOptionsNewsstandDownloadsKey. I've given you +1 for the tip about throttling though. Thanks!
Comments Off

Detecting background app launch in Xcode to debug a Newsstand app

I'm trying to breakpoint didFinishLaunchingWithOptions in my app delegate to capture the app being launched (in the background) when a newsstand issue download completes after the app was terminated. I believe it could happen for example if a user manually requests a download and then terminates the app.

On the info tab of the run scheme in the Xcode scheme editor there is an option to wait for the app to launch. The comment below it says that it is to be used when you want to launch your app manually. Although that isn't what I want, I have tried it anyway and not surprisingly it doesn't seem to do what I want. Does anyone else have a way of doing this?

Posted in ios, newsstand-kit, xcode | Comments Off

Answer by Martin Lockett for Different Property List format on IOS

Use a text editor, change the first <dict> to <array>, change the last </dict> to </array>, delete all lines beginning <key>Item

Comments Off