Customising a TableView - iPhone - iphone

I am trying to customise a TableView in my iPhone application. I have found many tutorials that do this but they are all for version 3.0+. I want to make my application as generic as possible so I can get it to work on as many iPhones/iTouches as possible.
Is it possible to create a customised TableView for 2.2.1 to 3? I've found nothing and am beginning to think that it's not possible.

You can customize the table in 2.2.1 AFAIK. In fact the tutorial you linked to above was written months before iPhone 3.0 was released!
But I have to agree with the comments above, supporting anything below 3.0 is probably not worth it. In particular, pre-3.0 you would initialize a UITableViewCell using initWithFrame, a method now deprecated. So if you decide to support 2.2.1 you risk your app not working on future releases of iPhone OS. With 4.0 around the corner this would not be a wise move.

Related

How do I write strings to the iOS Notes.app?

In my app, I have several strings that I would like to programatically turn into notes in the iOS Notes.app.
I have done the part of calling Modal View of Notes.
I'm not 100% sure what you mean because your question is too general, but if you refer to Notes.app that ships with iOS - it has no URL scheme so it's not possible to communicate with the app in any way, nor is it possible to save notes there.

Flash iOS applications

I am currently building an iOS application with flash CS5 and I would need some help with a couple of the features:
Is it possible to add in-app purchases? If yes, how does that work?
Is it possible to add iAd advertising to the app? If so, how? If not, is there any good alternative that works with flash?
How can I save data from within the app so it will be there eaten if the user restarts the app and even the device (like for a headboard and such)?
Any help is highly appreciated!!! :D
If it were a few months ago. Then answer would be an unequivocal no. However, presently, the answer is "perhaps" (or if you are an optimist, "probably"). With the release of Air 3.0, it now supports Native Extensions. These extensions are native code that have a wrapper API around them so that they can be compiled in with and called from an Air application.
In fact, I decided to look around real quick while researching for this answer and found a repo where it looks like somebody has implemented in-app purchases via a ANE. But I haven't tested this extension personally, but it may be a good starting point to see how it is implemented.
The reason you wont find too much information about ANE's yet is because they were only recently supported in the Air 3.0 update that happened last month. They are currently unsupported in Flash CS5 (or 5.5) or Flash Builder 4.5. They are supported in Flash Builder 4.6, which is currently in a closed beta. But you might be able to sneak in still, and it should be released soon.
The biggest "drawback" is that these extensions need to be developed in the native format for the device you are targeting. So that means, if you want to make an iOS extension, then you are writing it in Objective-C and xcode on a mac.
Pretty much the same answer as before. It should be possible with a ANE. But I haven't found any examples of anybody doing it yet.
It is very simple to save data/state to the device. You'll want to look into the SharedObject.getLocal() method if you want to the LSO. Or you can just use low-level File writing. Check out File.applicationStorageDirectory. For sensitive information that should be encrypted into into the EncryptedLocalStore class, which I believe is supported on iOS but not on Android.
All of these should provide a good way for you to persist data between application sessions.
With AIR 3 you can now use native extensions to call into the native platform code to achieve the functionality not provided by AIR Actionscript APIs. To answer your questions.
in app purchase. I have a sample at http://code.google.com/p/in-app-purchase-air-ios
iAd. I have a sample at http://code.google.com/p/iad-air-ios/
As others have already answered use local shared objects.

Recommended way to support backward/forward compatibility in iPhone app?

I'm in the early stages of an iPhone app and I have a question. I did some searching but did not find what I was looking for.
There are features in iPhone OS4 that I would like to take advantage of, but I would like for my app to also run on 3.X.
It looks like I want to develop against the 4.0 SDK and do the following:
Create a "weak link" to any new (4.0) frameworks
Call respondsToSelector: for any
new method in an existing framework
or any method in a new framework
before making that call
Am I close? What's recommended?
Pointers to similar questions welcome.
UPDATE:
Just as a note - if you are trying to check for a new framework, you're best chance is to call respondsToSelector: on a class method against the class object instead of using an instance method.
Yes, that's exactly how you do it!
The only other trick I can think of that you have not already mentioned is that you build against the latest SDK (i.e., 4.0 in this case) and set the target to be the earliest you want to support (3.0 in this case).
You might like to try using the 3.2 SDK to create a universal (iPhone/iPad) app. This is an Apple template that uses this same method to work with two different APIs.

Availability of older sample code for iPhone 2.2

We've been programming an iPhone application under iPhone OS 3.1, but the client has now decided he wants us to redo the existing codebase to run under 2.2. One of the nice pieces of built-in functionality we used under 3.1 was the UISearchDisplayController functionality for searching UITableViews, but that functionality was not available previously and I'm not sure how to create the equivalent code under 2.2 from scratch.
Long story short, does anyone know where I can obtain earlier sample code? The TableSearch example apparently existed under 2.2 and would likely be very useful to me, but I don't know how to obtain it. When I go to look online at the available Apple sample code, I'm redirected to the latest 3.1 versions, which don't do me any good.
Howard
I didn't have any luck tracking down that sample code either. You could try the wayback machine though.
Btw, just to give you some stats to take to your client. Currently > 75% of iPhone OS users are on 3.0 or better according to 3rd party sources. Writing code for <25% (and decreasing) of a market is generally not a good idea. It sticks you with code that is harder to maintain and test, etc., etc. I'm sure you know all this. Anyway, you should really see if you can convince them to drop 2.2.1 support.

iPhone 3.0 SDK vs iPhone 2.0 SDK

is iPhone 3.0 SDK significantly different that I cannot use any books that were meant for iPhone 2.0 SDK?
Programming is pretty much the same?
Generally as everyone said above, changes to UITableView and few other items. 2.0 books still will be a great way to start.
Generally skip over any chapters with sound there is a new framework called AVAudioPlayer which makes playing sound sooooo much easier.
3.0 added a lot of extra frameworks which are real cool.
CoreData which is quite complex but
can be used for storing complex data.
MapKit has been added which allows
you to add google maps into you
application. It also features reverse
GeoCoding which means you can give
the map your lat,long and it will
give you an address which is way
cool.
Now you can interact with the user
iPhone Music Library and play
their music in your app.
You can also access the proximity sensor
cut/copy/paste,
video
shake gesture
push notification
in-app purchasing
.
The iPhone 2.0 books should give you the basic idea of how to structure your code, however you will miss out on some of the nice new things such as the availability of CoreData. A few things have changed with some of the controls such as UITableView, however you will get deprecation warnings from the compiler if you try to do things the old way.
The language is the same, with the addition of some new classes and a few changes to old ones. Your 2.0 books will be fine. If you're not using new features that were added in 3.0, there's almost no difference.
So far the biggest difference I found in terms of features that were available at 2.0 is changes made to Table views, specifically to table view cells. Apple added a lot of nice features that are commonly used every where that you had to write yourself. In 3.0 some of those are given to you.
So my advice is don't worry about using 2.0 books but when you start working on something also consult the SDK's documentation to see if there are any interesting things not mentioned in the book (I guess that would be a good advice even if the SDK didn't change).