What are the main difference b/w ipad application code and iphone application code? - iphone

hey i am beginner in iphone application development.
i developed simple application in iphone but i also required it in ipad so for that i start coding for ipad but i didn`t get navigation properly in ipad code through
[self presentModalViewController:navController animated:YES];
[self.navigationController presentModalViewController:navController animated:YES];
for that i use addsubView Method but it didnt get its navigation controller from viewdidload method.
and please tell me how much this type of diffrences b\w iphone and ipad applications.....
if thier is any tutorial on ipad appication than tell me..........

Main difference between iPhone and iPad app is UI design, code behind the logic is same if you are using same components, there are some of the UI elements which are only iPad only like splitview, popup view as you start using these your code behind also changes.
you will get many samples on apple developers.

Related

iOS7: Navigation Bar and Tab Bar transparency looks different on a real iDevice

I'm currently developing an app for iOS7, using XCode5.
Today was my first attempt to test the app on a real device (iPhone 4 with iOS7.0).
I've noticed there is a difference between what I see in the simulator and what I see on the real device.
The Navigation Bar and Tab Bar are defined as follows:
[self.navigationController.navigationBar setBarStyle:UIBarStyleBlack];
[self.navigationController.navigationBar setTranslucent:YES];
[self.tabBarController.tabBar setBarStyle:UIBarStyleBlack];
[self.tabBarController.tabBar setTranslucent:YES];
The level of transparency is very different between the simulator and the real device, as can be seen in the screenshots below:
1.Screenshot from Simulator:
2.Screenshot from a real iPhone:
I can't find anything about that online. Am I doing something wrong?
Thank you.
sorry for poor english .. I'm using google translator.
I was having this same problem, but in colors of the buttons in the tabbar and navigationBar. I found that this is a configuration of iOS. On your device go to Settings> General> Accessibility> Increase Contrast.
It remains now to discover how to predict whether the user is modified with these settings and make adjustments via code.

Using popover control in iPhone

pop = [[UIPopoverController alloc] initWithContentViewController:popoverView];
pop.delegate = self; //optional
CGSize size = CGSizeMake(300, 100); // size of view in popover…V2
pop.popoverContentSize = size;
[pop presentPopoverFromRect:control.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
Youtube link: http://www.youtube.com/watch?v=1iykxemuxbk
It works fine in simulator, but crashes when running on iPhone.
I can easily get so many articles to implement on iPad, but on iPhone couldn't find a fruitful one. Plz help
UIPopOverController isn't available for iPhone. ONLY iPad.
UIPopOverController will not work for iPhone it will work on Ipad only
If you want to simulate a popover look-alike (e.g. Facebook app), on the iPhone, you will have to code it from scratch using UIViews and custom graphics.
As others said, the popover API is iPad-only.
A popover-like open source project that works on iPhone:
here it is
Try using WEPopover framework. Here is the link https://github.com/werner77/WEPopover
If you really want to use popover in iphone then try this library. This is pretty cool. I integrated with my ios app.
Custom popover controller for iphone

Adding iPad XIB/VIEW to a "View Based Application" in iOS 4

I've created a View Based Application in XCode4 and trying to do the code and UI design according to the way Apple have intended it to be.
So I designed the UI in the AppNameViewController.xib and it works fine; now I want to enable it as a UNIVERSAL application that runs on iPad as well. I changed the App-Target>>Summary>>Devices from iPhone to Universal and miraculously XCode had automatically created MainWindow-iPad.xib (Apple, very nice...), but since I designed the application first screen on the AppNameViewController.xib and not on the MainWindow.xib when I run the app on iPad Simulator I get this ugly screen where my UI objects size and location is distorted (their size is still set for iPhone so they are all crumbled on the left-top corner of the screen).
In my previous app I used the code appearing below to distinct between the AppNameViewControllerForIPHONE.xib and the AppNameViewControllerForIPAD.xib; It was done from the AppDelegate.m file, but in the new XCode View Based Application template the AppDelegate doesn't go through initWithNibName method at all.
Code I used on XCode 3 that cannot be used on XCode 4:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
viewController = [[AppViewController alloc] initWithNibName:#"AppViewControllerIPAD" bundle:[NSBundle mainBundle]];
}
else {
viewController = [[AppViewController alloc] initWithNibName:#"AppViewControllerIPHONE" bundle:[NSBundle mainBundle]];
}
Long question... still, anyone had any idea how it should be done here? Where should I design the iPad UI or is there a way to easily transform the iPhone xib to an iPad one?
You have to follow the new naming scheme (idiom in Apple-speak) specified for Universal Applications for the NSMainNibFile key in your info.plist. For example, if you set your NSMainNibFile to be "MainWindow-iPhone", the xib for ipad would be "MainWindow-iPad".
The same naming convention should hold for the views in a view based application (I can't test right now, installing new xcode).

How to convert an iPhone app to an iPad app

I am a beginner, and I have an iPhone app.
I want to convert iPhone app to iPad app.
I want to increase the size of all control, images and views according to iPad dimensions programmatically as I have no controls in XIB but in fact they are programmatically made.
I don't want to change the dimensions manually at every place because it is too much of a cumbersome work.
Is there any way I can do this in a better way?
The simple answer is NO.
You have to do it manually. There is no automatic system.
That is the correct answer.
if you have an absolutely trivial app - ie, with no images or controls or layouts! - you can of course just change it to an iPad app.
The questioner is asking specifically how to change all the images, layouts, and so on in a normal app. The answer is it must all be done completely manually. There is no automatic system for re-doing design or re-doing images in Photoshop, etc.
Note that similarly if you want to do both portrait and landscape layouts of an app, you or your designers have to of course simply design both layouts. There's no, say, "artificial intelligence" system that automatically does art direction for the app! You simply have to manually design both layouts and manually build in Photoshop all necessary images for each situation. The same applies to iPad v. iPhone.
(Note that sometimes you will have to do four totally different layouts, and sets of graphics .. for the phone/pad and portrait/landscape.)
This is exactly why iPad apps are sometimes labelled "HD" in the app store - they are of course totally different.
In Xcode, click on your project on the "Groups & Files" sidebar. Press command-I. Search for Targeted Device Family and change it from iPhone to iPad. Then it will compile and run on an iPad but the UI might look a bit funky.
What I did after that was open the xib I used for my iPhone app's FlipSide view (the one that looks funky on the iPad) go to File->Create iPad version and save it as FlipSideiPad.
Then when I load the view controller, I used the following if statement to tell my program to load the iPhone interface if the device is an iPhone or to load the iPad interface if the device is an not an iPhone.
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:#"FlipsideView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
}
else
{
FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:#"iPadFlipsideView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
}
I hope that helps.
You need to resize the view manually...there is no such single methods for converting iphone app to ipad

Augmented reality iPhone with ARToolKit, Pb with UIImagePickerController and UINavigationController

I am currently working on an app with augmented reality. I chose to use the ARToolKit library (available on github).
I have a little problem to integrate my view in my project.
The problem is that I can not see my navigationbar when UIImagePickerController is launched
AugmentedRealityController.m
- (Void) displayAr
[RootViewController presentModalViewController: [self cameraController] animated: NO];
[DisplayView setFrames: [[[self cameraController] view] bounds]];
)
I guess the problem come from here. I can not view the UIImagePickerController that if I go through presentModalViewController.
By making a pushviewcontroller from my navigation controller it does not work either (after read documentation).
After some research on documentation should be implemented by the delegate access UIImagePickerController and UINavigationController. Even with that it does not work either (sniff).
I picked this version here: http://github.com/nielswh/iPhone-AR-Toolkit/commit/681165d383ab590d03a0daaf761bc25b59d1acd6
I adapted a few things so that his running iOS 4.1 (actually this version is 3.1.3).
I do not know if there have been changes regarding the use of UIImagePickerController since.
If anyone has an idea, help or something. After half a day searching the internet I try many things in vain