Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-10-2012, 11:05 PM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 1
HeIsJohnny is on a distinguished road
Default NKAssetDownload Download Issues

I am currently creating an iOS Newsstand app. I have issues added and working the way I want. However, when I try to go and download their remote file, it doesn't seem to be working. None of the delegate methods are getting called and no file is being written.

This is what I know/have for certain:
  • A UITableViewController that is a NSURLConnectionDownloadDelegate.
  • UIBackgroundModes (in the info.plist file) has 'newsstand-content' added
  • #import is in the header of my UITableViewController
  • NSURLConnectionDownloadDelegate's methods are implemented

The Following code happens when the user agrees to download the issue (Note: Issue is not nil):

Code:
  // Download the Issue!
    NSLog(@"Starting Download of issue %@",issue.name);

    // Generate the url of the issue         
    NSURL * downloadURL = [dataManager pdfURLForIssue:issue];

    // Create the request
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:downloadURL
                                                           cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
                                                       timeoutInterval:30.0];

    // Create the NKAssetDownload object
    NKAssetDownload *assetDownload = [issue addAssetWithRequest:request];

    // Set user info so I know which issue's UIProgressView to update 
    [assetDownload setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:issue.name,@"Name",
                                nil]];

    // start download
    [assetDownload downloadWithDelegate:self];
I have no idea what is going on. From all I have read, I seem to have implemented everything properly; however, nothing is happening. I set breakpoints, NSLogs and such; but nothing. I even let it run for a while then checked the director the [issue contentURL] said the file would be moved too (in my connectionDidFinishDownloading:destinationURL: method).

Can anybody help? Or maybe some ideas for me? I have been stuck for days. If you need to see more code, just let me know. Thank you!
HeIsJohnny is offline   Reply With Quote
Reply

Bookmarks

Tags
ios, ios5, ipad, iphone, newsstand-kit

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 386
11 members and 375 guests
7twenty7, Atatator, buggen, guusleijsten, j.b.rajesh@gmail.com, morterbaher, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:37 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0