Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>Suggestion 1</h3> <p>Well, first of all, this code makes no sense at all:</p> <pre><code>- (void)viewDidLoad { userTimePicker = [[UIDatePicker alloc]init]; } </code></pre> <p>Consider what that does. Suppose you have a property or instance variable called <code>userTimePicker</code> (you must have something like that, right?). Now, either it is an outlet pointing to an actual date picker coming from the nib/storyboard, or it isn't. Well then:</p> <ul> <li><p>If it is, now it isn't! You've just overwritten the reference to the actual date picker in the interface with a <em>different</em> date picker.</p></li> <li><p>If it isn't, you've just set <code>userTimePicker</code> to a date picker, but that date picker is not in the interface (you have no code adding it to the interface).</p></li> </ul> <p>So, either way, from now on, <code>userTimePicker</code> is useless; it does not point to anything in the interface.</p> <p>So you would certainly need to fix that before doing anything else!</p> <h3>Suggestion 2</h3> <p>Also, I have a suggestion for why your results on the simulator differ from your results on the device: it might be because you've been testing repeatedly on the simulator. This can cause old code/resources to be present in the simulator version of your app. To fix that, clean out your caches and restore the simulator to its defaults, as I describe here: <a href="https://stackoverflow.com/a/6247073/341994">https://stackoverflow.com/a/6247073/341994</a> I'm hoping that will at least cause the simulator and the device to behave the same! And then you can get on with the <em>real</em> business of fixing your code.</p> <h3>Suggestion 3</h3> <p>This code is really weird:</p> <pre><code> CGFloat height = [UIScreen mainScreen].bounds.size.height; if(height==568.00) { settingsView.frame = CGRectMake(0.0, 50.0, 280.0, 370.0); }else { settingsView.frame = CGRectMake(20.0, 45.0, 280.0, 370.0); } </code></pre> <p>You should not be consulting the screen bounds for anything! All of this should be taking place within some view controller. The view controller's view should rotate and resize to fit the device orientation or screen size, so the bounds of the view controller's view will change, and <em>that</em> is what you should should be checking.</p> <p>And instead of hard-coding those frame values, you should express them in terms of the view controller view's bounds, or the bounds of the superview they are to go into. That will give you consistent results. Even better, if this is on iOS 6, use constraints instead of setting frames.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload