3

Using the iOS App (version 1.2.2) on iOS 8.2. I opened the app without an internet connection (worked fine), but then when I hit the menu button to go to the StackOverflow specific site the app crashed. Upon returning to a place with internet I noticed that all the sites usually listed in the menu were missing, so I logged out and logged back in. Now the app works, except that every time I go to the StackOverflow site from the menu (all other sites do work) the app crashes.

2
  • Try reinstalling the app. By the way, so what is your question?
    – 54D
    Commented Mar 24, 2015 at 7:47
  • 3
    @ArceusMaster0493 No question. This is where they say to report bugs so I felt I should share the story. Idk if it's happened to anyone else Commented Mar 24, 2015 at 14:40

2 Answers 2

3

This will be fixed in the next build. The error I'm getting is EXC_BREAKPOINT UNKNOWN which as far as I can tell is Swift's way of saying it has no idea what went wrong. I suspect it's similar to this bug where casting an array failed.

The original code looks like this:

func transformItems(items:[AnyObject], type:StacManTagPreferenceType?) -> [StacManTagPreference] {

    let preferences = items as [StacManTagPreference]
    if type != nil {
        return preferences.filter({ $0.tagPreferenceType == type! })
    } else {
        return preferences
    }
}

I think this will fix it:

let preferences = items.map { $0 as StacManTagPreference }

But I really don't want to crash on what really is an optional behavior so I'm doing this:

let preferences = items.map { $0 as? StacManTagPreference } .filter { $0 != nil } .map { $0! }
2

Reinstalling the app appears to have resolved the issue. Perhaps this is an isolated incident, but just in case it's not hopefully there is a fix simpler than this and that the cause for this can be resolved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .