MBProgressHUD icon indicating copy to clipboard operation
MBProgressHUD copied to clipboard

Crash in viewDidAppear

Open egorzhdan opened this issue 12 years ago • 10 comments

My app crashes on setting labelText in viewDidAppear. Is it a bug or I'm doing something wrong?

screen shot 2014-06-20 at 16 19 30

(iOS SDK 8.0)

egorzhdan avatar Jun 20 '14 12:06 egorzhdan

I'm not sure this would have to do with MBProgressHUD and an iOS 8 incompatibility, and I haven't started playing with the 8 SDK or Swift yet, but it may have to do with mixing in your Swift-Strings, or keying your comment strings as you are currently

coryallegory avatar Jun 23 '14 15:06 coryallegory

progHud = MBProgressHUD(view: self) progHud.labelText = "Loading..." progHud.center = self.center progHud.delegate = self self.addSubview(progHud)

pass string value directly in label text progHud.labelText = "Loading..."

Renish-GlobeSync avatar Jul 19 '14 10:07 Renish-GlobeSync

Is this still an issue?

matej avatar Aug 12 '14 05:08 matej

It's still happening, yes.

dzenbot avatar Sep 21 '14 20:09 dzenbot

Can anyone come up with a quick sample project that illustrates this? This doesn't make any sense to me. labelText is just a regular synthesized property. Unless it's something with KVO.

matej avatar Sep 22 '14 06:09 matej

happening for me too. when i try to set the labelText, I get an error 'unexpectedly found nil while unwrapping optional value' (using swift / ios8)

Nathan187 avatar Oct 06 '14 18:10 Nathan187

Could this be a Swift bug?

matej avatar Feb 05 '15 07:02 matej

I alse face this problem.

stevenlfg avatar Mar 16 '15 01:03 stevenlfg

Is this relevant? http://stackoverflow.com/questions/24643522/fatal-error-unexpectedly-found-nil-while-unwrapping-an-optional-values

"You can prevent the crash from happening by safely unwrapping cell.labelTitle with an if let statement.

if let label = cell.labelTitle{ label.text = "This is a title" }

You will still have to do some debugging to see why you are getting a nil value there though

dxclancy avatar Sep 30 '15 03:09 dxclancy

This API has now been updated a bit. I hope that accessing label directly works better.

matej avatar Jan 31 '16 17:01 matej