Is there a different way to view the iOS Simulator in Xcode 5 / Am I viewing my button correctly? - objective-c

So I'm doing the Ray Wenderlich tutorials on iOS, and I'm doing the button tutorial. When I run the app, I get something that looks like this:
I have two questions:
I often see simulators show up in the form of an actual iPhone and was wondering if that was possible, or if that rectangle is the only way to view it?
The reason I'm asking is when I connected the button to an action (It says 'Pressed!'). So, is it supposed to show up in the box (bottom right) only, or should it should up on the simulator itself- mimicking what the user would see on-screen?

Regarding your first question: Probably a problem with screen size. See also here How can I restore the iPad frame around iOS Simulator 5.1?
The output seen in the screenshot is produced with NSLog and won't be seen on the device. You need to add an UILabel or such and set its text.

In the Simulator menu, try selecting Window then Scale and go to 50%. The retina models are far too big on my screen. Also, the old iOS 6 simulator with standard iPhone did look like a real phone, so examples from a while ago will look different.
If you want to support iOS 6.x, you can load it into Xcode. From Xcode main menu, select Xcode and then Preferences, and go to the Downloads tab.

Related

How to deal with the ios Launch files

It has been a while since I created my last app and I missed the change with the launch file (since titanium 5.2.0).
I want my app to have a custom splashscreen (full screen image). In the past I used the various png files for the splashscreens Default.png, Default#2x.png etc.
I'm testing with the launch file and the custom Storyboard. At the moment it's not clear to me how I can achieve the behavior i want: A full screen image in the splash screen.
What is the best approach?
Thanks for the help.
Go to http://docs.appcelerator.com/platform/latest/#!/guide/Icons_and_Splash_Screens-section-29004897_IconsandSplashScreens-iOSgraphicassetrequirementsandoptions and take a look at the Purpose column. You'll see 9 splash screen sizes. You have to make each of them and put them in app/assets/iphone. Note that you have to name them exactly as told in the table.
This worked for me, Ti-5.4.0 tested on iPhone 7, iPad Air, iPhone 4S and iPhone 6S Plus.
Since version 5.2 storyboards were introduced. You can use them or you can disable it and use the "old" method to implement splashscreens.
To disable it, add this to tiapp: (of course, within the existing ios section in tiapp
<ios>
<enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
</ios>
To use it, look at the documentation how to implement it correctly.

Buttons not working on ipad simulator

I've recently updated my project for iOS 10 and now the buttons on the bottom of the screen don't work in the ipad simulator. Other buttons in the app work while in the ipad simulator and all of the buttons work on all of the other simulators. Tried searching around for this problem but didn't find anything so I'm pretty stumped.
Edit:
Buttons that aren't working are "Bet High", "+", "-", "Bet Low". You can click them and tell they are clicked by the animation but the action linked to the buttons aren't getting called. Clicking the ad works too
screenshot
Edit #2:
Now I feel stupid. After poking around with NSLog I found that the iPad Pro (9.7 inch) simulator thought it was a 3.5 inch display so it was using my storyboard for 3.5 inch displays which didn't have those buttons hooked up to their corresponding actions (still weird though as each storyboard was duplicated from my original storyboard for the 4.7 inch display which had everything hooked up when duplicated)
*face palm
Check the UI like storyboard, buttons and so on. You can try rebuild the button again. If the problem still happen again, copy the sample code from internet like Apple Developer and check your code. You can also the your simulator and run it again.

Xcode added Default-568#2x.png

About a week ago xcode showed me some error and when I clicked to solve the problem, xcode added this picture:
My questions are: What is it good for? Why do I need it?
Thank you.
Yes you must include one.
From Apple's Interface Guidelines
To enhance the user’s experience at app launch, you must provide at least one launch image. A launch image looks very similar to the first screen your app displays. iOS displays this image instantly when the user starts your app and until the app is fully ready to use. As soon as your app is ready for use, your app displays its first screen, replacing the launch placeholder image.
Without this default image (or a LaunchScreen storyboard), your app would not take all the available screen space on iPhones with 4" displays (iPhone 5, 5s, SE). This is the default image that those iPhones would use.
Of course you can (should!) change it with the one you designed.
Runtime, leading to the top and bottom of applications were empty out a lot , because the application is based on a 320x480 size to run.

Display App in 3.5" Resolution on iPhone 5 for Development/Debugging

Does anyone know if there is a way to force an app you're developing to run in a 3.5" screen size mode if you're on an iPhone 5, just for dev/debug purposes? Something such as what might look like a toggle in the Development section of Settings or something. In other words, run the app such that it LOOKS like it's running on a non-5 iPhone (black bars on top/bottom), that way I can test certain UI functions.
For clarification, I'm NOT saying "I don't want to support iPhone 5" - I most certainly do. Also, I'm aware that I can do the 'old' retina display in the simulator, but I do not want to use the iOS Simulator as the app includes libraries that do not support i386 architecture, uses push notifications, and heavily relies on GPS to function correctly. I'm just looking for a way to test both aspect ratios on the same device to save money/time.
Thank you!
It appears that by removing the app from device, deleting the Default-568h#2x.png launch image, cleaning the project, and re-running app, I can get the functionality I'm looking for, although not as nicely as a toggle switch.
Letter box in iPhone5

How to position static buttons and iPhone 5

I am working on an app where i have 12 buttons and labels underneath on one of the views. They are placed on the storyboard directly. I want to make sure they will get properly repositioned in iPhone 5. The solution that i tried is just to deselect all the lines in the autosizing for all the buttons. Now when i try it on iphone 5 the buttons get resized. The problem if i stretch the storyboard and move the buttons they get messed up when running on the smaller screen. So i can only position them on the smaller screen and then it seems to work. The app does not rotate. I would like to know if this is a good solution or there is a better solution for this case. I would like for the app to support iOS 5+
Thank you!
If you want layouts to work with varying screen sizes, you should become familiar with the new constraint-based layout scheme in iOS 6. A WWDC video on the subject can be viewed at http://www.youtube.com/watch?v=Dkr9eKxlMAk&feature=player_detailpage.
Essentially, you're going to use the old struts and springs system for pre-iOS 5 and conditionally use the new scheme for iOS 6. (iPhone 5 won't run any iOS version prior to 6.)