Jun 22 2010

My First Look at Objective-C

Category: iPhoneJoel Ivory Johnson @ 03:14

I registered for iPhone development almost a year ago and haven't done a danged thing with my registration since this. This weekend I finally decided to take the time to look at it and willful decided that I would neglect most of my weekend demands in favor of learning something new. I've heard a lot about Objective-C (primarily from people that don't use it on a regular basis) and primarily wanted to experience it for myself.  I keep hearing the phrase "It's C trying to be like C++." That's usually said while some one is declaring that Objective-C is not a good programming language. 

My thoughts? I see where the phrase "It's C trying to be like C++" came from. But I'm not going to agree (or disagree) with the statement. When developing in C++ the VTable and other information about the class is pretty much abstracted away or not  accessible to other pieces of code. C# by contrast shares much of this information through the Type class and other metadata objects that one can probe. In Objective-C the class data is actually stored in a struct. An object of type X will have a reference to the structure that defines  members of X. One can walk through this structure, examine the child members of a class, and so on.  

There were some other things that looked notationally cryptic at first but quickly started to make sense, such as one syntax available for calling methods. In the C languages one might see a call like X.DoY(); but in Objective-C one may see it written as [X DoY].

As per usual if I do a lot of reading on something I'm going to end up writing something down. In this case you can see the collection of my notes as an article on Code Project in a getting started article ( http://www.codeproject.com/KB/iPhone/iOSGetStarted00.aspx ). If you see places where it can be improved then be gentle with what you say; this was my first time looking at iOS programming. So I'm sure there are a few things I've missed.  I might come back and read more about Objective-C and eventually write something else. But for now I'm going to return to my concentration and finish up some Windows Phone 7 projects I'm working on.

Tags: ,

Oct 25 2009

iPhone 3G Blackra1n Failure - What am I doing wrong?

Category: iPhone | MobileJoel Ivory Johnson @ 20:16

I've been reluctant to jailbreak an iPhone since the release of the 3.0 firmware.  When I made an attempt to jailbreak the iPhone 2G and 3G under the 3.0 firmware the results were less than desirable.  I ended up with a jailbroken phone that could only run the applications that are built into the iPhone.  I could freely copy applications onto and off of the iPhone but they would not run. Clicking on their icon resulted in the opening screen of the application breifly showing before returning to the homescreen. The phones were both jail broken and app broken.   I left the iPhone 2G in this broken state and gave it to some one else that only wanted to use the device as a phone (the web browser and appstore are completly unused on the phone).

Having repeatly heard how easy the jailbreak for the iPhone 3G is with Blackra1n I finally started to feel brave and gave it a try.  The result was a series of innocuous failures and wasted time. Each time I ran Blackra1n the iPhone would enter recovermode and never progress any further (note: in one attempt the picture from the Blackra1n website displayed, but that occurred only once and never progressed further).  I mad emy attempts across Windows Vista, Windows 7, and OS X 10.6. On the windows machines I made attempts with the phone with airplane mode turned on and turned off. After the series of failures I restored the iPhone back to factory state (which took much longer than I expected) and tried again across the machines. the results were the same.

Having wasted several hours on attempts I'm giving up for now.  If you've got any idea what I may have done wrong please make a suggestion on this video that I've uploaded of a failed attempt

http://www.youtube.com/watch?v=JYDWFux1abo

Update: In case you were curious here is my log file.

***
INFO:  welcome to blackra1n for windows
INFO:  loaded dll at C:\Program Files (x86)\Common Files\Apple\Mobile Device Support\bin\iTunesMobileDevice.dll
INFO:  button clicked
INFO:  internal device callback called
INFO:  callbacks registered
INFO:  sent enter recovery command
INFO:  internal recovery callback called
INFO:  unregistered normal mode callback
INFO:  go go gadget ra1n
INFO: send command started
INFO: file opened
ioctl: 1
INFO: command setenv auto-boot true sent
INFO: send command started
INFO: file opened
ioctl: 0
INFO: command saveenv sent
send payload: 0
INFO: start sending exploit
ioctl: 0
INFO: exploit closed 0
sent exploit
INFO: send command started
INFO: file opened
ioctl: 0
INFO: command geohot sent
ERROR: usb open failed while sending payload
ERROR: usb open failed while sending payload
send picture: -1
INFO: send command started
INFO: file opened
ERROR: usb open failed while sending command
INFO: send command started
INFO: file opened
ERROR: usb open failed while sending command
ERROR: usb open failed while sending payload
ERROR: usb open failed while sending payload
send ramdisk: -1
INFO: send command started
INFO: file opened
ERROR: usb open failed while sending command
INFO:  I JUST DROPPED IT LIKE ITS HOT
WARN:  wtf who called this?
INFO:  global callback finished

Tags:

Aug 7 2009

.NET for iPhone

Category: iPhone | MobileJoel Ivory Johnson @ 19:42

The group behind mono-project has released another port of the .Net Framework.  This one is targetting the iPhone.  Their port has some iPhone specific libraries in addition to supporting some common libraries.  The benefit that mono-touch brings is that an existing .NET developer can use his or her skills to develop for the iPhone.  You stil ned the iPhone SDK to deploy to the emulator and must be a registered developer to deploy to hardware.

Ofcourse some of the restrictions on the iPhone mean that certain features of the .NET framework cannot be made available to the iPhone.  APIs based on dynamic code, reflection, and COM are not available. For more information see the mono-touch page.

found via msmobiles.com

Tags:

Aug 6 2009

Free to Emulate, 99 USD to Deploy

Category: iPhone | MobileJoel Ivory Johnson @ 08:05

A few days ago I decided to try out some iPhone development. Upon attempting to run my first program on actual hardware I got the following error:

"Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain"

I did a quick Bing search to find out what it meant and as it turns out while the iPhone SDK is free if you want to run your programs on hardware you must get a certificate. The certificate comes with the $99 fee for registering as a developer.  I'm learning that "free" comes with cost. :-(

I'm not going to register as an iPhone developer just yet since I don't plan to sell anything. Besides, having already paid 99 USD for Xbox 360 development, 99 USD for the Widnows Mobile Marketplace, and 413 USD for the Plasma OS / Android development software and hardware from Creative I think I need to throttle back my spending.

Tags:

Jul 30 2009

Free to download, $99 to use

Category: iPhoneJoel Ivory Johnson @ 17:24

I decided to try out some iPhone development and upon attempting to run my first program on actual hardware I got the following error:

"Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain"

I did a quick Bing search to find out what it meant and as it turns out while the iPhone SDK is reportedly free if you want to run your programs on hardware you must get a certificate. The certificate comes with the $99 fee for registering as a developer.  I'm learning that "free" comes with cost :-(

Tags: