I am new to iOS development. I want to build a simple game with sparrow or cocos2d (whichever of these i find more useful). I want to know that whether sparrow framework is compatible with iOS 3.0. I wanted it so that the game also works on iPhone 1. I also want my game to work in iPAD. Lastly which one of these would be more useful to develop simple 2D games on iPhone- Cocos2D or Sparrow?
Sparrow Framework has a System Requirement for at least iOS 3.0 which must mean it supports iOS 3.0 which works on the iPhone. It also says it runs on all hardware generations which includes the iPhone 1.
Source: http://www.sparrow-framework.org/info/features/
Related
I have a macOS app that I wrote years ago; it has been working well on my Mac. Recently I thought it would be nice to have that same app on my iPhone so I added an iOS target to my Xcode project. I have never built for iOS before so I'm on new ground here.Anyway, when I built for iOS, I got an error message: "Cocoa is not available when building for iOS." In Apple's "Cocoa Fundamentals Guide" there is a prominent statement: "Cocoa is a set of object-oriented frameworks that provides a runtime environment for applications running in OS X and iOS."Does that mean I can run an app that uses Cocoa but not build one? I'm at a loss; I have no idea how to get past this one. Can an iOS app be built without Cocoa? How would I even go about doing that? Any suggestions at all will be welcome. I'm running Xcode 12.5 on macOS Big Sur 11.4. My app's UI is written in Objective-C and its muscle is in plain C. Also, my app is only for my own use, not for publication.
Anyway, when I built for iOS, I got an error message: "Cocoa is not available when building for iOS." In Apple's "Cocoa Fundamentals Guide" there is a prominent statement: "Cocoa is a set of object-oriented frameworks that provides a runtime environment for applications running in OS X and iOS."
That's somewhat confusing wording. iOS uses a variation on the Cocoa theme called Cocoa Touch. More specifically, the user interface framework on macOS is called AppKit while the iOS user interface framework is UIKit. If you're comfortable with AppKit, it's not hard to learn enough UIKit to get things done. Other frameworks (Foundation, Core Graphics, Core Data, etc.) are pretty much the same on both platforms.
Does that mean I can run an app that uses Cocoa but not build one?
No. You're going to have to rewrite at least the user interface parts of your app before it'll run on iOS. iOS devices obviously use a somewhat different user interaction model: there's no hardware keyboard, no mouse, a touch screen that can handle multiple simultaneous touches, a much smaller screen, and a variety of sensors that don't exist on the Mac, so a different approach to interacting with the user is different. If you were careful to separate the business logic (model) from the user interface (views) in your Mac app, you'll likely be able to reuse most of that unchanged.
Try to rewrite your code using Cocoa touch or UIKit. I am not good at iOS coding, by the way as I know Cocoa framework is for Mac OS, the framework for touch devices is Cocoa touch.
Do I have to rebuild my existing apps with the Swift language in order to support iOS8 when it will be released and the most of iPhone owners upgrade to this version? If I must rebuild my apps to new standards or not? At moment my apps are running under iOS6.
My main concern is if I have to abandon the iOS6 version or not.
I watched the announcement, but here's a blog to support me :
Matter of fact, Swift code can co-exist with Objective-C...
Developers don’t need to choose between C for Mac development and Objective-C for iOS development because Swift supports both iOS and OS X and can co-exist with C and Objective-C code.
For the time being, Apple plans to support both Swift, Objective-C, and hybrid apps built with both.
No, you do not need to abandon iOS 6 .. although with 89% of devices running iOS 7, you may considering doing it soon ...
No, you will not need to rebuild your apps with Swift. The compiler compiles Objective C and Swift down to the same code to run on your iPhone and both languages can co-exist. Objective C will likely be phased out gradually over a number of years.
If you still wish to switch your existing apps over to Swift, here's a handy migration guide from Apple.
A quick curiosity.
If I develop an application with ios 5(e.g core audio kAudioUnitSubType_AudioFilePlayer) components and set the deployment target to ios 4 will the ios 5 components work on an ios 4 device?
Since nobody can travel back in time, you cannot use iOS 5 features on iOS 4.
However, you can write an app that runs fine on iOS 4 and uses iOS 5 features if available. For example, you can ask a class whether it implements a method using respondsToSelector:, and if so, you can call it.
With kAudioUnitSubType_AudioFilePlayer, you can simply try to initialize the audio unit with AUGraphNewNode but on iOS 4 you will get an error (but not a crash).
An application running on iOS 4.x only has access to the APIs available in the 4.x frameworks.
I'd recommend for new apps, as of today... that you develop for iOS 5 using iOS 5 features. After you are done, do some regression testing on iOS 4. Whatever is broken, re-write, or allow the app to do something different at runtime (you can check if an object would respond to a method before calling it ;)). This will allow you to use all the sweet iOS 5 stuff with the least 'settling'. My team created some of the new features in iOS 5 IN iOS 4 (dealing the the navigation controller) so that the code would require very little change.
Does Cocos2d iPhone framework work on iPad?
My guess would be yes, but wanted to check if someone has a definitive answer after porting iPhone project with cocos2d to iPad, or starting a new one.
Cocos2d v0.99.0-rc was released today which formally supports the iPad.
http://www.cocos2d-iphone.org/archives/511
Apple confirms that all applications available in the app store can be run on iPad
See this link: http://www.apple.com/ipad/app-store/
With that said, Cocos2D is just an opensource library which consists mostly of Objective-c/Cocoa code. It will work just fine.
Also, Apple developer program (link here: http://developer.apple.com/iphone) mentions: "iPhone Developer Program Members can begin developing iPad applications with iPhone SDK 3.2 beta".
Go ahead and get started...
According to Engadget, the iPad runs all iPhone apps with no modifications which means that it supports the Cocos2d library.
Engadget
I am about to release my first app to the iTunes store. What version of the iPhone/iTouch should I be targeting to hit the most people?
The default in XCode is 3.0.
OS 3.0 adoption is currently at about 47% (less among iPod Touch users), so I'd certainly recommend targeting 2.0 if at all possible.
Update: here's an article with the statics (this one actually puts iPhone adoption of the OS at 44% and iPod Touch at 1%).
You should target the lowest dependency, if your application builds and works for the iPhone 3.0, you have a larger target audience who can download it. There isn't much different from 3.0 -> 3.1 API wise, so it would be best to target for 3.0.
The iPhone OS is backward compatible with apps targeted to earlier SDK versions. So, if your app is built with 2.0, it will usually run on 3.0/3.1 without any problems (you should definitely test it though!). Thus, my approach is to always target the earliest possible SDK version, depending on the features needed in that app. If your app doesn't leverage any of the 3.0 stuff (such as push notifications, map view etc.), build with 2.0 or 2.2 - this way you reach much more people.