Cells content appearing on simulator and iPhone but not on iPad - ipad

I have two quite simple custom cells in separate tableViews that since I ported my project to iOS 6 just show their content on the simulator and the iPhone but not on the iPad. What is strange is that even some static objects I added to the cell or even a coloring of the background do not show up either like there were some link to the storyboard missing that curiously only show up in the device.
What could it be and how could I check better what is going on?

As a matter of fact I was testing two different localizations in the simulator and iPad by being tricked by a string I forgot translating. The problem boiled down to the the storyboard returning me an empty prototype so bringing my program to run an old piece of code that in that case created a new (empty) cell. Why the storyboard returned nil when asked for a prototype cell is still unclear; yet once I found that one localization worked, I copied that configuration to the other ones and everything returned back to order.

Related

IOS DEV: Should I be concerned if the Main.storyboard layout looks different from the actual layout?

So for my app, the tableview layout in the iOS simulator when I click run is CORRECT and as I intend. However the layout is not always 100% the same when I view the layout of the tableview in Main.storyboard. When I refresh Xcode(i.e. quit and restart app), the layout of Main.storyboard is what I intend. However, if I play around with orientations/diff iOS devices within Main.storyboard, and then return to my original device, the layout looks incorrect (even though supposedly the math/measurements are correct). Do I need to be concerned?
For reference I followed the instructions of https://www.ralfebert.de/ios-examples/uikit/uitableviewcontroller/custom-cells/ EXACTLY to make a cell (instead of an image, I used a button though). And here is an image of my iPad simulator https://drive.google.com/file/d/152scJF6h12amh-AAycDqpe6TXOzN2y-H/view?usp=sharing vs the main.storyboard simulator https://drive.google.com/file/d/1NvUfMVLk08S8qH4mFraRsQYbDzPdjaBG/view?usp=sharing
However the layout is not always 100% the same when I view the layout of the tableview in Main.storyboard.
It sounds like you might have some missing or incorrect constraints. Take a look at the little yellow arrow icon to the right of "View Controller Scene":
That icon tells you that there are some issues that you need to resolve. Click it and you'll get a list of the particular issues and your options for fixing them.
Do I need to be concerned?
The risk, of course, is that under some circumstances your view won't draw the way you want it to. Start by fixing the issues that Xcode is pointing out, and then test on lots of different devices (or simulators) as you can, in all the possible geometries you might encounter (different screen sizes, orientations, split view, etc.).

All of my objects disappear in my iOS simulator, why is that?

I'm currently working with one navigation controller, and 3 view controllers. when i run my program, everything runs smooth, but none of my objects on my second and third view controller appear in the simulator ( labels, buttons, text fields etc.), how ever the navigation bar is there. why is that? how do i fix it?
For me, the issue was that I had added the button to the LaunchScreen.storyboard, instead of the Main.storyboard.
Credit to this post: http://discourse.djp3.net/t/first-ios-app-button-and-label-disappear-in-simulator/104/13?u=drazisil
Apparently it was an auto layout error. I removed auto layout and disabled size classes from my project and the simulator showed every object within the interface. I then enabled both auto layout and size classes once again & manually added my constraints instead of allowing Xcode to do it for me. Worked out fine once i ran the simulator again. I think this is a bug in Xcode's iOS sim.

iphone-Xcode 5 xib/storyboard Problems

Okay- I have this space shooter app based on uiimageviews. Originally, I made it on Xcode 3. Then, I converted it to Xcode 4. However, I did not use story mode. I stuck with the .xib files and it worked fine after I edited some of the basic code around. Then, when Xcode 5 came out, I couldn't do that anymore. When I tested my app on the iPad, most of the screen was grey and only the top corner had my game in it. I would like it to be able to auto size using just the xib files. Also, with the 4 inch and 3.5 inch iPhones, how can i make a view that fits them all? I tried storyboard, but my app was based on .xib files. It is one view controller, but it loads a lot of different .xib 's. What is my solution?
The solution is to switch your app from universal to just iPhone.
You can find a solution to a problem, similar to the one you are having, in the following stackoverflow How to convert a project using XIBs to Storyboard?

UILabel text alignment only working in iOS simulator

I've created a custom cell with several UILabels and everything works great, but for some reason I can't seem to get the text in any of my labels to do anything other than center.
Everything was created in Storyboard, and I set the left-alignment attribute, it looks perfect in the simulator, but when I test my code on my iPhone, all the labels center.
Since it's all in Storyboard, there isn't really any code snippet I can share, is there something I'm missing?
Did You remove app from device ? sometimes when adding/testing style features, old style is appended, until You delete the app.
Do one or both of the following:
Remove the app from your device and re-build it onto the device
Remove the folders in the DerivedData associated with your app. By default, the DerivedData folder is is located at /Library/Developer/Xcode/DerivedData/
This usually fixes all the Ui-related issues I've come across.
It turned out that autolayout was changing the size of the Labels in my cell, turning that off seems to have resolved the issue for now.

iOS XCode Storyboard controls moved and now look strange in simulator

I am following the course on iOS through iTunes university and working on the calculator project. I moved the controls on the storyboard to make room for another control at the top. Everything looks fine on the storyboard but when run in the simulator, controls are bunch up, on top of each other, and some are clearly off the top of the simulator screen. This leads to the following very related questions.
How does one move controls around on the storyboard? I went to the size inspector of each control (buttons in my case) and changed the 'Y' value (increased it by 10). I did this for each control. I didn't think about it as I was doing it because as I said, all looks fine on the storyboard. Is there a better way to move controls around? I could not figure out how to grab more than one control at a time and move them. Grabbing all and moving or all but one and moving would have been ideal.
I anticipate someone is going to say, "We need more info. " How do I show the storyboard? Is there a xml file somewhere? How is the storyboard saved? How should I show the results of the simulator?
In general, what the heck is going on? Why would things look so different in the simulator?
Is there a better forum/group to ask newbie questions about iOS programming?
My specs are these:
XCode 4.5.2
Ios simulator versions set to 6.0 and iPhone
Any other info needed? Thanks in advance,
Dave
Try setting your simulated device size to 'freeform' instead of 'inferred'. This screen is a bit smaller so the controls are no longer overlapping. The latest xcode sets it by default to ios6 (screen size of iPhone 5)
edit For a better insight in xcode IDE, please refer to the documentation provided by apple (includes screenshots for clarity)
https://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/000-About_Xcode/about.html#//apple_ref/doc/uid/TP40010215

Resources