hallo zusammen,
probiere gerade an diesem tutorial herum:
github.com/arled/RSSwift
wenn ich nun eine feed url in den FeedTableViewController eingebe (zeile 17) und mir die WebView anschauen möchte, crasht die app, sonst funktioniert alles.
Code:
Alles anzeigen
xcode gibt folgende meldung:
2015-07-14 21:45:00.721 RSSwift[8389:240166] +[_UIDictionaryManager _availableDefinitionDictionaries] returned nil. Error: Error Domain=ASError Code=21 "The operation couldn’t be completed. (ASError error 21 - Unable to copy asset information)" UserInfo=0x7ff1cb41d830 {NSDescription=Unable to copy asset information}
2015-07-14 21:45:01.275 RSSwift[8389:240166] Unbalanced calls to begin/end appearance transitions for <_UIFallbackPresentationViewController: 0x7ff1cb4f18e0>.
2015-07-14 21:45:06.668 RSSwift[8389:240166] +[_UIDictionaryManager _availableDefinitionDictionaries] returned nil. Error: Error Domain=ASError Code=21 "The operation couldn’t be completed. (ASError error 21 - Unable to copy asset information)" UserInfo=0x7ff1cb7846b0 {NSDescription=Unable to copy asset information}
fatal error: unexpectedly found nil while unwrapping an Optional value
hat es was mit url encoding zu tun?
über hilfe wäre ich echt dankbar....
probiere gerade an diesem tutorial herum:
github.com/arled/RSSwift
wenn ich nun eine feed url in den FeedTableViewController eingebe (zeile 17) und mir die WebView anschauen möchte, crasht die app, sonst funktioniert alles.
Code:
Quellcode
- import UIKit
- class FeedTableViewController: UITableViewController, UITableViewDataSource, UITableViewDelegate, NSXMLParserDelegate {
- var myFeed : NSArray = []
- var url: NSURL = NSURL()
- override func viewDidLoad() {
- super.viewDidLoad()
- // Cell height.
- self.tableView.rowHeight = 70
- self.tableView.dataSource = self
- self.tableView.delegate = self
- // Set feed url.
- //url = NSURL(string: "http://www.skysports.com/rss/0,20514,11661,00.xml")! //DIESE URL FUNKTIONIERT
- url = NSURL(string: "http://www.loeschzug-humfeld.de/index.php?option=com_reports2&view=home&format=feed&type=rss")! //DIESE URL FUNKTIONIERT NICHT
- // Call custom function.
- loadRss(url);
- }
- func loadRss(data: NSURL) {
- // XmlParserManager instance/object/variable
- var myParser : XmlParserManager = XmlParserManager.alloc().initWithURL(data) as! XmlParserManager
- // Put feed in array
- myFeed = myParser.feeds
- tableView.reloadData()
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- }
- override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
- if let newUrl = segue.destinationViewController as? NewFeedViewController {
- newUrl.onDataAvailable = {[weak self]
- (data) in
- if let weakSelf = self {
- weakSelf.loadRss(data)
- }
- }
- }
- else if segue.identifier == "openPage" {
- var indexPath: NSIndexPath = self.tableView.indexPathForSelectedRow()!
- //let selectedFeedURL: String = feeds[indexPath.row].objectForKey("link") as String
- let selectedFTitle: String = myFeed[indexPath.row].objectForKey("title") as! String
- let selectedFContent: String = myFeed[indexPath.row].objectForKey("description") as! String
- let selectedFURL: String = myFeed[indexPath.row].objectForKey("link") as! String
- // Instance of our feedpageviewcontrolelr
- let fpvc: FeedPageViewController = segue.destinationViewController as! FeedPageViewController
- fpvc.selectedFeedTitle = selectedFTitle
- fpvc.selectedFeedFeedContent = selectedFContent
- fpvc.selectedFeedURL = selectedFURL
- }
- }
- // MARK: - Table view data source
- override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
- return 1
- }
- override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return myFeed.count
- }
- override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
- // Feeds dictionary.
- var dict : NSDictionary! = myFeed.objectAtIndex(indexPath.row) as! NSDictionary
- // Set cell properties.
- cell.textLabel?.text = myFeed.objectAtIndex(indexPath.row).objectForKey("title") as? String
- cell.detailTextLabel?.text = myFeed.objectAtIndex(indexPath.row).objectForKey("pubDate") as? String
- return cell
- }
- }
xcode gibt folgende meldung:
2015-07-14 21:45:00.721 RSSwift[8389:240166] +[_UIDictionaryManager _availableDefinitionDictionaries] returned nil. Error: Error Domain=ASError Code=21 "The operation couldn’t be completed. (ASError error 21 - Unable to copy asset information)" UserInfo=0x7ff1cb41d830 {NSDescription=Unable to copy asset information}
2015-07-14 21:45:01.275 RSSwift[8389:240166] Unbalanced calls to begin/end appearance transitions for <_UIFallbackPresentationViewController: 0x7ff1cb4f18e0>.
2015-07-14 21:45:06.668 RSSwift[8389:240166] +[_UIDictionaryManager _availableDefinitionDictionaries] returned nil. Error: Error Domain=ASError Code=21 "The operation couldn’t be completed. (ASError error 21 - Unable to copy asset information)" UserInfo=0x7ff1cb7846b0 {NSDescription=Unable to copy asset information}
fatal error: unexpectedly found nil while unwrapping an Optional value
hat es was mit url encoding zu tun?
über hilfe wäre ich echt dankbar....
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von humfeld ()