Friday, 24 June 2011

IOS 5 I already think it may help me...

Today I 'ave mainly been thinking that IOS 5 looks to have a couple of nice features that will help me with programming the iphone/pad. Follow this link to see what apple have put on offer.

Automatic Reference Counting sounds like it will prevent me from worrying about garbage collection in Objective-C programs. Hooray!

Storyboards sounds like a new way to define the structure of my iphone/pad app. I need a new way because I am having trouble deciding the current best way.

Wednesday, 15 June 2011

One way to make an iPad app and have an iPhone app that does the same thing

Today I 'av mainly been wondering if I can keep my iPad app in step with my iPhone app without copying the code by hand.

Then I had a great idea! Why not use my favorite language Python to help. The idea is to make an iPad App called 'ipad app1' and make the interface and write the code. Then make a iPhone app called 'iphone app1' make the interface (identical to the ipad except smaller) but write no code. Then use this small script to keep the 2 projects in step.

I have tested it on a tiny project now for something bigger...

Sunday, 12 June 2011

Ok Two More Chances

Today I 'ave mainly been upgrading my code from XCode 3 to XCode 4. The one more chance before was for XCode 3.

Now I am a fully paid up IOS Developer I have a shiny new version of XCode. Sounds good, always exciting to get a new program to play with. However things have changed a bit so I have a bit of re-learning.

First impressions are good and I am liking the whole thing more.

Monday, 6 June 2011

Time to Give Xcode and Interface Builder one more Chance

Toady I 'ave mainly been making a minor breakthrough with my understanding of how to write simple iPad/iPhone apps. I wanted to be able to design a simple App that has Buttons and Labels using Interface Builder. Then get my Objective-C code in Xcode to respond to button clicks and update the Labels on the display. Not too much to ask?

I have spent some time reading a Book and browsing Apple Docs and watching uTube videos.

But still it was not obvious to me what had to be done in order to connect a button on the nice Interface Builder screen with a callback in my Xcode code. I had the same problem with Labels.

As you would expect, the answer turned out to be easy. Once you get into the Xcode/Interface Builder mindset.

I was expecting that on the Interface Builder Button screen I would click and get the Interface Builder to produce me some code to handle the button click. This is what I have seen in GUI builders before. This is NOT what happens. This is what took me by surprise.

Instead you go the the Interface Builder to design your screen by adding buttons and labels. This is good because you just concentrate on the design and layout of the screen. You do not worry about the code to make the application live.

When you are happy with your design, you go to the code and add Label objects and Button handlers to your code. In the code you do not say anything about how Buttons or Labels look on the screen (colour/size/position etc.).  This is also good as you just concentrate on behavior. You simply write callback handlers for the buttons and update the text on the Label objects.

The last bit of the trick is to make the Labels visible to the Interface Builder by using the IBOutlet specifier and also make the Button callbacks visible by use of the IBAction specifier. Once you have declared the IBOutlet andIBActions it is then easy to connect the Buttons and Labels in the Interface Builder to callbacks and objects in the Objective-C.

The exact mechanics of this are easy and, if I get time I will try to produce a uTube video showing you how. (I have watched several uTube videos that left me confused.)

I now have a simple App that is ready to try out on a real iPad.. Its now a question of time...