Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

xib outlet not loading correctly on iPhone 5C

$
0
0

I have a very simple view with a button and a label. In XCode's Interface Builder I ctrl-dragged to get a reference to the UIButton and called it btnPlay. In my view controller I have this code:

public override void ViewDidLoad()
{
    base.ViewDidLoad();

    // On my phone this line causes a crash:
    Console.WriteLine("Button title: {0}", btnPlay.CurrentTitle);
}

When I run the app in the iPhone Simulator (3.5" Retina / iOS 7.0) all is well. Inspecting btnPlay at a breakpoint shows it as a MonoTouch.UIKit.UIButton object.

When I run the app on my iPhone 5C (iOS 7.0.4) btnPlay shows up as a MonoTouch.UIKit.UIView object which has no CurrentTitle property and so crashes the app.

What can be the cause of this?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>