If I want to write an iPad app, do I have to buy an iPad? - objective-c

To program for the iPhone, you need an iPhone. That's because you have to compile the final version of the app on the iPhone hardware.
Do you also need an iPad when you program for the iPad? Or will an iPhone also do the job?

You do not need to have an iPhone to be able to compile your program for the device, and you do not need to have an iPad to compile your program for that device either. It's good to be able to test it on an actual device before you submit it, but it is not necessary. All compilation happens on the computer, not on the iPhone or iPad.

You should have one. Those of us who released iPad apps on iPad release day can certainly tell you that there are differences between the Simulator and the device. I had two minor but ugly errors which went out with our first release of Reiner Knizia's Money for the iPad, one of which had to do with different case comparison on the two devices. I would have never seen them if I didn't have a device to check.

I would imagine that for testing alone you would need an iPad. Although I've never developed on either one, basic quality control says that you really should test any app on the actual hardware it is intended to run on.

I'd say Yes, you need an iPad. Reasons, precise and real memory warnings, device wifi's real speed latency, 3g. And here's the tricky one: Some libs/features just don't work on the simulator but they work on the device and viceversa.
But I mean, you can always be googlish and search for these later cases I mention, and just be sure that you are doing things right. Otherwise, get yourself an iPad, you don't lose anything.
-edit: I didn't read the question correctly... the short answer: You don't need an iPad to compile the final .app file, but take my advice.

YES. (Unless you have no respect for your users and don't care about the quality of your app)

No. You don't even have to get a developer license from Apple. You can just download XCode and the official iOS4 SDK and develop the application in the simulator.
However, there's small caveat - the simulator does not always behave like the real device. So at some point you want to have a device to test your app on.

It would certainly help to have one, but not necessary at first. Get some experience programming for your iPhone, and once you feel ready, start working on something for the iPad. The simulator works great for most tasks. However, I wouldn't release any finished product to the app store unless it had been thoroughly tested on hardware.
There are cases where it is necessary to have hardware. For example, I was doing some testing involving dragging your finger across the screen. I needed to step through the debugger while doing this. Using the simulator was impossible, since I couldn't lift my mouse pointer from the iPad screen and interact with the debugger at the same time. Having hardware allowed me to interact with the device, while working in XCode at the same time.

Not having the target device for your software is a recipe for poor user experience. Touch interfaces cannot be accurately duplicated with a mouse. There are also very specific problems with relying on the iPad simulator:
1) The actual iPad has a slower processor than the desktop simulator. Stuff that looks fast in your simulator can be slow on an actual iPad
2) The iPad simulator is not fully correct, especially in simulating web browser experience. Real iPads have weird painting issues, CSS sanity differences, caching oddnesses, and then just more crashes than the simulator.
3) Orientation changes need to be performed on a real iPad! The simulator can just misleading. Ditto for network fetch latencies, which can affect the user experience significantly especially on a 3G link. If you don't have a real iPad you'll never notice that you need load masks, "waiting for content" watermarks etc.

Related

Can't we use Instruments with a real-device attached, instead of using iOS simulator ??

Am currently using Xcode6.4 , and I am actually trying out the Instruments (time profiler) for the first time...
The Instrument is working fine if I choose simulator and somethig wierd is happenning when I connect to a real-device(iOSv8.3)...(i.e)the application hangs.
My question is that is there a way to use instruments with a real device connected ??
Pls do share if u came across the same probs and found a solution ...
Thanks in advance..
Yes you can.
Here is Apple documentation that talks about it a bit. Note this paragraph:
In order to use Instruments to profile an iOS device, your
device must be provisioned for development before data can be
collected from it. See Provisioning Your iOS Device for Development.

Cocos2dx performance issue on Windows Phone 8

I'm trying to port an android/iOS game to windows phone 8(cocos2dx v 2.2). I'm using the exact same code base that I've used for android and iOS. The game functions just fine, but I facing some major FPS drop. The game runs flawlessly at 60FPS in android and iOS, but I'm getting roughly about 35FPS on wp8. Has this got to do anything with differences in OpenGL and directX?
I doubt its got to do with the game's logic and calculations because when the game starts in windows phone, it starts with 60FPS on the main menu, which has got like 5 sprites. But as I add more sprites on the screen, say about 30 of them(average number of sprites when I'm IN the game) the FPS rapidly drops to 35-40 range. Note that there are no schedulers or update functions running at this point. I did the same test on Android, but the FPS didn't drop. Does the win8 port of cocos2dx suck?
Any help,comments or redirection to useful articles would be appreciated.
Thank you.
In case anyone runs into similar issue, I reduced the number of children in the scene and deployed the build in release mode. Gave a major boost to the FPS. Also, I had a bunch of float to string and int to string conversions happening in every frame inside the update function. That was eating away on the processing speed too.
Actually, the Cocos2dx port for WP8 is ok, but outdated. Cocos2d-x is now at 3.0 beta, but the WP8 was left at 2.0 alpha.
Anyway... in Cocos there are some recursive drawing functions which are very heavy on the CPU, and also, keep in mind that even though WP8 is supposed tu support arrays, lists, maps etc. they are very slow on WP8.
And since you came to this subject, Please let me know if you managed to successfully put cocos2d-x on an XAML+D3D Interop project. I am getting tons of crashes.
EDIT: Indeed, the recursive calls which process (draw or update) child "CCNode"s are very heavy on the device. However, after putting Cocos2d-x ver. 2.0alpha for WP8 into a XAML+D3D interop project, I found a whole lot of memory related issues. Apparently, after doing this (or just because I don't know how to properly configure my VS project and allow loose addressing), a lot of uninitialized pointers and data cause some memory overlaps, leading to major crashes.
This proves only that it was truely an alpha release :) Too bad no newer version of Cocos2d-x for Wp8 is available.

Debugging methods for finding the location and error that's causing a game to freeze

I recently I came across an error that I cannot understand. The game I'm developing using Cocos2D just freezes at a certain random point -- it gets a SIGSTOP -- and I cannot find the reason. What tool can I use (and how do I use it) to find out where the error occurs and what's causing it?
Jeremy's suggestion to stop in the debugger is a good one.
There's a really quick way to investigate a freeze (or any performance issue), especially when it's not easy to reproduce. You have to have a terminal handy (so you'll need to be running in the iOS simulator or on Mac OS X, not on an iOS device).
When the hang occurs pop over to a terminal and run:
sample YourProgramName
(If there are spaces in your program name wrap that in quotes like sample "My Awesome Game".) The output of sample is a log showing where your program is spending time, and if your program is actually hung, it will be pretty obvious which functions are stuck.
I disagree with Aaron Golden's answer above as running on a device is extremely useful in order to have a real-case scenario of where the app freezes. The simulator has more memory and does not reproduce the hardware of the device in an accurate way (for example, the frame rate is in certain cases lower).
"Obviously", you need to connect your device (with a developer profile) on Xcode and look at the console terminal to look for traces that user #AaronGolden suggested.
If those are not enough you might want to enable a general exception breakpoint in Xcode to capture more of the stacktrace messages.
When I started learning Cocos2D my app often frooze. This is a list of common causes:
I wasn't using sprite sheets and hence the frame rate was dropping drammatically
I was using too much memory (too many high-definition sprites. Have a look at TexturePacker and use pvr.ccz or pvr.gz format; it cuts memory allocation in half)
Use instruments to profile your app for memory warnings (for example, look at allocation instruments and look for memory warnings).

OSX Lion and Movist: playback freezes at specific instant

I'm a newbie developer who worked on Movist media player over the last months.
The project seems to be dead so I started to look at the code and try to understand how it behaves.
I have been able to add hardware decoding (with VDADecoder), fix all deprecated functions, plus other minor things and everything seems to work nicely on Snow Leopard.
When testing the app on OSX Lion, instead, I encounter a very annoying issue and I'm short of idea because I tried quite everything..
The video playback freezes for about 0.1 - 0.2 seconds always at the same instant during the playback. It seems to freeze just when the decoder reaches the end of file and when the remaining (already) decoded frames get displayed.
The issue appears with both hardware and software decoding and it's not related to the part of code that I have added.
Obviously, the same movie file plays smoothly on Snow Leopard (with both software and hardware decoding) and on Leopard (with software decoding) (hardware decoding isn't supported).
I tried to use Instruments to debug this issue but I don't know how to catch that instant. Sometimes Instruments records a lot of "sys enter trap" around that instant..is this a hint?
I tried to rebuild the project with Xcode 4 and SDK 10.7 and to fix all the warnings but the issue still persists.
Is there a way to debug this issue?
I don't know how to discover the bug...if there is any..
I hope you can help me.
Regards
Andrea
Just to let everyone know, I found what was causing the issue.
It was given by the Restorable feature of the movie window which was causing that periodical stuttering.

scrollview scrolls smooth in simulator but not in device?

i have page control sample from apple and using it in my application... in my application scrolling is running smooth in simulator but when installed on device it is not smooth.
does someone knows about it? i am also doing some flip animation.it's also not running smoothly
The fact that it is running slower on the device (potentially several times slower) is completely normal. The simulator is not cycle accurate, it has access to all of the RAM, GPU resources, and processors on the host system.
Without actually knowing what you are doing no one can tell you how to improve performance, but there is nothing wrong with your app that is making it run slower and choppier on the device than in the sim that can be fixed to make it perform like it does in the simulator.