Transitioning to new bleepbox site
I posted some new sound samples over here. Further bleep!BOX updates will occur there from now on. Today I finished up a couple outstanding things and started implementing the new GUI. Hoping to finish most of the GUI stuff tomorrow. It's looking pretty sweet.
Useful objective C libraries
- three20 - bunch of nice utils.. supposeduly includes facebook connect
- JSON Framework
- KissXML I used this in my rss reader
Possible to develop iPhone apps in Java?
The above link describes a method for converting Java source code into Objective C using xmlVM. xmlVM sounds pretty interesting, though the site is down at the moment..
BleepBOX! screenshots
Here's a few screenshots of BleepBOX. These are essentially wireframes - I will be implementing the 'pretty' version of the GUI this weekend.
Day 4 (screenshots)
Day 4, learning Objective C
I completed my custom control yesterday - it's a simple knob style control. I feel I understand the basics of Core graphics and implementing a UIControl from scratch (including getting touch input, sending a an 'event' when someone interacts wwith the control, etc). To reskin an existing UI Control, you would just subclass it and override any methods you want to change. This may include some of the input methods if you want to control how people interact with it. If you want to change the look/feel then you can override the drawRect method. Core Graphics is very similar to other UI frameworks I've used, such as LibNUI, Swing and Juice, so no troubles there.
Today I started working on an RSS reader to learn some more of the specifics about working with the UITableView component, which is probably the most used component of all.
Some more good resources I came across this morning:
Day 3 learning objective c
Getting more comfortable with the language. Working on coding some custom controls, figuring out CoreGraphics, etc. Also installed the new OS 3.0 stuff.
Questions:
- Why do I see this in some example source: NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; .... some code ..... [pool release];
Why is this necessary? - Why is it that messing up a method call on an Objective C object results in a crash that provides no useful debugging info? it seems like most crashes on the iphone don't give you a proper line number.. Am I missing some project setting?
Day 2 learning objective C
(for those that don't know I am taking a week to learn apple's Objective C. Bleep! BOX (my other iphone app) is written in C++ using LibNUI, so I haven't had to touch any Objective C so far)
Today I investigated Objective C++. Basically, if you rename your .M files to .MM then you can mix C++ code in with your Objective C code. Seems to work just fine. It's pretty common to interface with C/C++ libraries from Objective C (several example apps do). If I am ever forced to write iPhone apps that need to use standard GUI widgets then I would probably use regular Objective C for the interface and C++ for all the logic and data. Aside from being easier to work with (for me anyway), I think this will provide better separation between UI code and 'back end' code.. A lot of the Iphone examples I've seen so far have controllers for specific pages holding onto 'model' data. This can lead to architectural problems because there are a lot of cases where you want the two to be seperate and independent. I see the same issue with a lot of Flash code too, since the recommended way of doing things is always to subclass one of the Display classes. I usually find that using singletons for app-wide data is a better choice than attaching your data to a UI specific class.
I am also looking through the rest of the example apps, trying to learn more. A couple that caught my attention are the Wi-Tap app which shows how to do basic TCP connectivity (once again this references C++ code to get the job done), and also the LaunchMe app. Apparently it's possible to set up a custom URL type to launch an iphone app.. IE, have myappname://www.someurl.com/ open up your app. This would be cool for Bleep! BOX to allow people to browse a bunch of user submitted songs in safari and have the ability to click on one to open it up in the app. Seems very easy to implement.
AccelerometerGraph is the first example I've looked at so far that gives a good 'low level' look at how to make a UI component that draws itself. It also manually creates UI items which gives a better look at how things work internally. Digging in deeper..
More learnings:
- @selector is basically a delegate. Use it to call methods in response to actions
- In terms of reskinning existing objects, you can use Categories to override or add methods on objects without actually subclassing them. Though I'm a little unclear on how this works. Once I've made a category, does this apply to all instances of that object or can I choose whether I instantiate the the regular 'uncategorized' version of the object or the 'category' version?
- UIView - addSubView is how you add 'child' views.
- Good Info: http://www.iphoneexamples.com/, http://cocoadevcentral.com/d/learn_objectivec/
- This is interesting. A code only approach to iPhone ui - convert XIB to code: http://kosmaczewski.net/2009/03/17/nib2objc/
I'm starting to write my own Control from scratch. This is how I got started with LibNUI and should be a good way to get started with UIKit.
Thoughts on Objective C
This is my first day trying to learn Objective C. Here's my thoughts so far - some of these may be wrong since I am still a newb.
Learning a new language is always a bit frustrating at first, so bear with me.
What is it
- Objective C seems like it started with C, took a few OO concepts from C++ and added manual reference counting memory allocation out of the box. Somewhere along the way, syntax got beaten to death with a hammer, resulting in a strange, unique syntax. This gets a big frowny face from me - almost every modern language shares a similar syntax (Java, C++, C#, Actionscript, Javascript, heck even PHP once you get past the dollar signs) - being different here only makes it hard to learn and there's no reason it couldn't have a more C++ or Java like syntax.
What's weird
- Why come up with an entirely new syntax and language? Objective C is rumored to be less efficient than C++ and doesn't seem to offer any benefits. Programmers still have to deal with pointers (in the sense that bad reference counting can still crash your applications). Poor use of reference counting can easily lead to memory leaks. There doesn't seem to be anything particularly slick or time saving about the language itself.
- When declaring an interface, why are methods and variables outside of the brackets? Also, it's not necessary to declare methods as part of the interface? Seems like this kind of defeats the purpose of having an interface.
- Way of declaring and calling methods (esp methods with parameters) is strange and not very readable..
What's nice
- Interface builder is kind of nice.. Ability to click and drag to connect outlets is slick. However, I find myself wondering if I couldn't do things faster just by creating the interface "by hand" with code. Even simple stuff requires a lot of setup..
- @property, @synthesize
So far every application I try to write from scratch crashes and burns. Oh well, there's always tomorrow.
First sample + name
Here's the first official sample of my iphone app, which will be called 'Bleep! Box'
Features me mixing it up live using the 'looper' in realtime. All sounds synthesized in realtime. This is only about 7 parts of a possible 10. There's one or two more 'big ticket' items to finish up (such as deleting presets, copy and paste for patterns, etc), and I still have to re-skin the gui. Probably be another week or two still before I can really say it's done.




