Default UIView width is 768 in UIViewController iPad Landscape mode?

I create a Storyboard with a UIViewController in iPad landscape mode.

I put some logging info in UIViewController and it says the default width of the default view in UIView is 768 but I think the default width for landscape mode should be 1024. ( I use self.view in the logging info). Why would this happen?

Answers


You must have logged self.view in viewDidLoad. The main view always loads in portrait, even if the current device orientation is landscape (and even if the only orientation supported by the app is landscape). Log self.view later in the view controller life cycle (e.g., viewDidAppear:) and its dimensions will probably match your expectations.

Also, it doesn't really matter what the orientation is in storyboard, it's just a simulation.


Need Your Help

Display Javascript links in a table

javascript html css

Hi there I am trying to display my links in a table. The links are getting pulled from a JSON data source and I want to just display the brand names in the td tags. The goal would be to have:

Parsing huge (~100mb) kml (xml) file taking *hours* without any sign of actual parsing

ruby xml timeout kml large-data

I'm currently trying to parse a very large kml (xml) file with ruby (Nokogiri) and am having a little bit of trouble.