App works on iphone simulator,iphone device, ipad simulator but not ipad device - iphone

So I made an app, And it runs on all possible platforms except the ipad device. I would understand if it ran on the ipad device and not the iphone device since the processor is better on the ipad, but this has me stumped. It also worked fine on the ipad simulator. Can anyone think of a reason why this could be?

There are too few details to give an explanation. A possibility is: when you run the app in two different devices, iPhone and iPad, some nib files could be different. Even the app delegate is different if you use XCode templates for universal apps. So this means that it is possible that the code executed is different in the two devices.
So imagine that in the iPad app delegate / view controller you're allocating - at launch - a lot of memory (scroll view with many large images for example). Then the app will not crash in the simulator (it uses your Mac memory). The app will not crash in the iPhone (different code). So at the end it will crash in the iPad only.
Other possibilities: you're going short in memory very soon. But the iPad 1 has less memory than iPhone 4G.
Other possibility: the watchdog timer kills your app at launch. It happens on the iPad 1 only because you're loading a few large images and it takes a lot of time, just enough to be killed by the watchdog.
Other possibility: iPad 1 is still with iOS 3.2, while iPhone and simulator are linked to iOS 4.0. In this case it is easy to have the app crashing in iPad 1 by calling one of the many new APIs introduced with iOS 4.
As you can see there are many possible explanations...

add target for device or convert it to universal application
Yes, it's easy to target both platforms. If you login to ADC and read the Programming Guide, it'll provide the basics for specific development. I can't legally speak of the "how."
Um. If you follow their directions, build two targets, share your source within the same project... then you'll be set. It's the same SDK, just different Nibs & main(), from what I can tell.

You say different xibs... you might be missing an Outlet connection somewhere.

Ok gents, sorry but I did not provide enough information for any of you to correctly answer this, but! here was my problem.
I had a login screen with 2 textfields, and a submit button. The submit button would release the current view and add a new view. I would usually press submit while the keyboard is being shown. Aparantly this makes everything blow up. You must manually hide the keyboard first. Hopefully this saves somebody some time.

Related

Iphone resolution on an Ipad

We have an app that has been rejected in the review process by the Apple app review people. The cause for the rejection is that the app is not scaling properly when run on an Ipad.
The app was never meant to be run on an Ipad, but there seems to be no point in arguing with them about that.
Apple sent us a couple of screenshots that show our app being run on an Ipad with the top portion of the view cut off. Notice how the app is run in some mode where it looks like an Iphone app and does not fill out the entire display area. When we bring up the app on an Ipad, it fills out the screen and does so without any edges cut off.
Can anyone please tell me how to run the app on an Ipad the way the Apple guys have - Iphone-sized? We believe we have a fix for the issue but we need to reproduce the error and then be able to verify that the fix solves the issue.
(the logotypes in the images are intentionally blurred)
I just went through this myself and here is how I resolved it:
Go into info.plist and see if any of the supported interface orientations are set for iPad. Despite selecting iPhone only, I had iPad supported orientations for four (portrait, portrait upside down, landscape left, landscape right). I deleted those.
I also deleted any reference to the launch screen in the info.plist. My app is pretty simple and there's no preloading of data so I don't really need a launch screen. If you do, you could go old school and make your first VC the launch screen.
I then made these changes in Target-->General-->App Icons and Launch Images
That was the only way I could get it in the sim to run the app at iPhone resolution while running an iPad (iPad2, iPad Air).
If Apple is going to force developers to ensure an app runs on an iPad even if it is made just for iPhone, they should eliminate the iPhone Only and Universal options and just have iPad Only as an option.
To run an iPhone app on an iPad, you just need to:
Acquire an iPad (you can also use the simulator)
Set the target device family in Xcode (it's under your target) to iPhone
Connect your iPad, perform any necessary certificate dances
Run the app on the iPad.
As long as the target device family is set to iPhone, the iPad will show your app in this mode.
Apple is likely running your app on a simulator, not on a real device. Notice the "2X" on the top right. In XCode - you should run the app on iPad Retina Simulator. On the bottom right you will see a button that you can toggle from 1X to 2X.
If you place the simulator in "2X" mode, you will see what Apple is seeing.
What OS are you running on your iPad? Things have changed in iOS 8 - and that's likely why you're not seeing what Apple is seeing. My guess is that your are running an app that was initially developed for iOS 7 or earlier - which means that you need to upgrade from scaled resolution to native resolutions to resolve this issue. Here is how you do it:
How to enable native resolution for apps on iPhone 6 and 6 Plus?

convert an ipad app to iphone app with custom views

This might be a repeat question.But i have a problem. I have an iPad app functional. The app is built in iOS 6. When i started building it i chose iPad as targeted device NOT universal. Now my client has asked for an iPhone version of it.In my iPad app i keep adding custom views as the client clicks "Add More".I add a custom view which is bunch of textfields, buttons etc.So i copied my iPad app and changed the Targeted device family to iPhone once and also Universal next time and tested it. So when i launch the app in iPhone configuration (keeping the targeted device family as Universal) my view controller stays like that on iPad. I cannot scroll the app also(not up/down..nor sideways). Is this the correct way to convert iPad app to iPhone app . Also everything is still with scale to iPad. Should i start a new project and start everything from scratch.Set the storyboard to fit according to iPhone configuration? In my research people said just change the targeted device family to Universal. But it doesn't work. Please let me know if you need more information. Thanks.
It is possible to convert the current project you have to an app that can be used universally, but it would take more time than simply just creating a new project that allows universal usage, and adding in the files of which you used for your iPad project.
Hint: You can use more than one storyboard when the project was created universally. It will automatically set this up for you.
I would also advise that you separate your files into what works universally, and what is specific for the iPhone or the iPad.
Happy Coding!
After many search i found that it possible to have an application for both Iphone and ipad devices.but in your code you should define unique ui for each device(two xib file).

Iphone app on Ipad - make Ipad select 640x960 instead of pixelated 2x320x480

This is for avoiding an extra target and writing any target-specific adaptation code for the Ipad, separate apps on App Store, etc etc - but instead let the Iphone app display in 640x960 rather than 320x480#2x using the "2x" button.
Even on a non-retina Ipad, there's room for 640x960, but the Ipad is still running Iphone apps on the Ipad as if they were made only for Iphone 3GS.
This is for an app used internally by a company and any authorized client/partner. The company has bought Ipads, but the clients/partners may want to use the Iphones they have.
So, I'm looking for a compile-time target flag or a snippet of code to execute to detect the platform is Ipad and make it display the window full-size.
Has someone succeeded in doing this and if so, how did you achieve it?
This isn't really how things work ... you're trying to create a workaround that will probably take you longer to get to work (if at all possible) than it would if you just commit to making iPad friendly layouts.
If you just make the project a universal binary, then it would run "natively" on the ipad rather than in iphone compatibility mode. After that, the simplest thing you could do is just make sure your view's resize masks are set correctly so they stretch. Depending on the complexity and makeup of your app, many times this is enough to get you through. However, in many cases it would behoove you to just make an ipad specific layout as usability is oftentimes greatly improved.

Testing universal app on iphone only

I am developing a universal ios app and the iphone version is nearly done and about 50% of the ipad. However I need to get started testing the iphone version. Therefore I changed the project only to be a iphone target. However when the app is on the ipad, the nib files for the ipad version is loaded in the iphone simulator. Therefore you only see a fraction of the ipad screen in the iphone simulator. One solution is to remove the references to the ipad nib files, however I would like to avoid this approach.
Anyone one with suggestions?
Regards
EDIT: The problem is if I want people to be able to test the iphone version on a ipad(some people only have an ipad not an iphone). When running the iphone simulator on the ipad, it would load the wrong nibfiles. Those intended for the actual ipad and not the iphone.
You don't want to "change the project only to be a iphone target". Change it back and just build and run on the device (iphone or ipad depending upon which one you have plugged in).
Btw, in future I STRONGLY recommend that you test early and test often - e.g. test on devices every day.
Okay, it ended up with the solution I did not want to do :) I removed the nib files intended for the ipad and it removed the issue. After the test I will have to add the ipad nib files to continue working.

iPhone VS ipad development process (differences and similarities)

I am new to iOS development. I am trying to figure out these things.
A project both in iPhone and iPad. what things are same for both (coding, graphics or UI)?
Design Pattern of apps are same or different?
waiting for answer
Thanks :)
Personally, I find that the only real difference between the iPhone and the iPad is the UI and UX. Most of the code is the same for both applications. (In fact, you can even reuse a lot of code if you are doing a universal app!)
The main difference really is the screen size. The iPad is huge in comparison to the iPhone, and this difference gives you a lot more options to work with.
Another thing to note is that the iPad is usually done in landscape orientation, whereas the iPhone is done in portrait. This is not an absolute rule however, it's just the way I see it.
The graphics aren't too different between the devices, except that because of the large screen size, you can do a bit more detailed work with the iPad images then the iPhone images. (Even with the retina display, too fine detail on the iPhone is barely noticeable.)
The other thing I wanted to mention is the flow of the devices. Again, because of the screen size of the iPad, you can fit a lot more content on the screen, and therefore have to push to new views less frequently. I've worked on apps where we had 3 UIViewController's for the iPhone version, and only 1 for the iPad version.
In short, it depends really on your type of app. If you have a lot of content, and want to display it all at once, go for the iPad. If you want a streamlined, minimal approach to your app, go for the iPhone.
Again, this is all just my personal opinion. Hope that Helps!
You can use native controls without much theming and customization on the iPhone. But iPad is a bigger beast. Users use your iPad app for a longer time. iPhone apps are used for a short stint and then closed, used again for a short stint and so on.
Analytics published by Flurry showed that the average time an iPhone app is kept open is about 1.2 minutes. Design and develop it in a way that data is available as fast as you can.
iPad apps are used in a relaxed setting. While I don't have the numbers, it's probably used more often and for a longer time than an iPhone app. Themes and custom UI elements do matter a lot there
Second, iPad apps need to be supported on all orientation (or at least a minimum of two orientations)