Links: iPhone Dev Help Forums | Live Chat | iPhone OS Programming Guide | Apple Developer Site

Wednesday, April 30, 2008

Apple Design Awards

Are you entering the Apple Design Awards?

I received this email today:


The Apple Design Awards 2008 features two new categories which recognize innovative iPhone application development: the iPhone Developer Showcase and the Best iPhone Web Application. Submit your iPhone SDK application, or iPhone web application, and let your work take center stage.

Entries will be accepted through May 12, 2008."

Post comments if you are and let everyone know. See you at WWDC 2008!

Monday, April 28, 2008

iPhone Dev Help Chat Feature

I added a chat feature to the site. You can enter the chat room here:
Campfire is a great application by 37Signals that allows collaborative chatting. The chat room has a limit of 4 people, but if people like this service I'll upgrade to their unlimited plan.

Please post comments if you like it.

Wednesday, April 23, 2008

New iPhone Firmware Installed

Just installed the new firmware. Getting closer to being finished. It seems a lot more stable, and the iTunes Store link is back. The App Store button has been added. The App store doesn't work yet though (no surprise).

After playing around I found some new features:

  • Password fields now show you the last letter you typed for a few seconds.
  • Application now asks the user to allow or disallow access to the user's location (similar to how J2ME applications ask for LBS information)

iPhone SDK Beta 4 is out

Apple released iPhone SDK Beta 4 today. The simulator now supports OpenGL ES, and they added more features to the Interface Builder, Instruments, Frameworks, and Samples.

Get it here:

200,000 iPhone Developers and Counting!

200,000 people willing to pay $99 to write code for the iPhone (and its still BETA!). If that isn't impressive, i don't know what is.

Here are the details:

Tuesday, April 22, 2008

NSDate Confusion

I was working with the NSDate class for my iPhone applications and was using descriptionWithCalendarFormat:timeZone:locale: to display my date objects. It compiles and runs fine, without any errors/warnings, on the simulator only. Once you switch your active sdk to the device instead of the simulator the compilation fails. I had to use NSDateFormatter instead, which compiles fine on both.

This seems like a bug to me, but I'm wondering if anyone else experienced this situation with other methods. Its really annoying to develop on the simulator only to find out when your testing on the device that the code isn't available.

So be careful when developing to check and make sure your code compiles on the device sdk as well, because you'll be stuck with code that doesn't work on the device but runs fine on the sim.

Thursday, April 17, 2008

Core Location Framework Issues

I'm writing an application that uses the Core Location framework. It only waits for one call to the delegate, then stops waiting for location updates. My Core Location application was running into problems recently. The latest location update is usually 8 hour old. If I run Google Maps application it acquires the location just fine, then when I load my application it also gets the correct location. Then I noticed the Google Maps application works differently. The circle pulsates, and the location updates continue narrowing down my location.

So I went digging in my code, and I fixed the problem by continuously updating (not calling [manager stopUpdatingLocation];) until the timestamp of the latest location is less than a minute old.

What confuses is me is that no where in the documentation does it say that Core Location will return with an 8 hour old location even if I have my desiredAccuracy set to 1000 kilometers.

The CLLocationManager shouldn't call the delegate if the location is 8 hours old. Or even 30 minutes for that matter. Hopefully this is a bug and will be fixed in future firmware version.

Monday, April 14, 2008

O'Reilly iPhone Development Book

O'Reilly released an iPhone development book:

They are quick! Came out in March. I'm reading the book on Safari. Looks good so far. You can read some sample chapters here: Link

This book isn't about the iPhone SDK though, but all the topics covered should still be helpful. The book describes how to use UIKit and other APIs available in the SDK.

Save images in iPhone Safari to your phone

In the latest iPhone firmware build 5A240d, beta 3 you can save images on any website to your phone by holding your finger on the image.

Now you can save images, and use them as wallpaper!

Been hoping they'd let us do that since I got my iPhone. Good stuff!

[via Gizmodo]

Sunday, April 13, 2008

NSUserDefaults how I love thee!

I'm finding more and more gems in iPhone development that make me really happy. My recent find is NSUserDefaults. Coming from a J2ME and Windows Mobile development background things like NSUserDefaults make me miss J2ME and WinMobile less and less.

NSUserDefaults is a very easy way to store application specific defaults and settings. You instantiate NSUsersDefaults, and then just start saving your records in a Key-Value pair. Depending on the domain you choose to save your defaults NSUsersDefaults will either store your defaults on the filesystem or in memory.

Here's how you use it...

Instantiate NSUsersDefaults:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

Save your defaults:
[defaults setObject:@"felix" forKey:@"Username"];

Get them back later:
[[NSUserDefaults standardUserDefaults] stringForKey:@"Username"];

That's all to it! 

Now I bet all you J2ME developers are thinking "So what?! J2ME has RecordStore class!" RecordStore is similiar, but doesn't work nearly as nice as NSUserDefaults. NSUserDefaults also has a lot more capability than what I talked about here. Check out the documentation and you'll see what I mean.

Thursday, April 10, 2008

UITextView vs UITextField

UITextView and UITextField sound similar but are actually pretty different. Once difference that has been really bothering me lately is an issue with UIReturnKeyDefault and UIReturnKeyDone. For those that don't know what this means...When you select a UITextView or UITextField for input the keyboard automatically pops up to allow the user to enter text. The problem is how do you hide the keyboard once typing is done. UITextField's have the ability to hide the keyboard using the keyboard "Done" button. UITextView's can't be closed with the "Done" button even though it supports displaying it with setting the objects returnKeyType. What is the point of displaying the "Done" button when there is no way to hide the keyboard when it's clicked.

You might ask: "Why not just use the UITextField, and not even bother with the UITextView?". Because the UITextField only allows text input on one line. I'd like the ability to have a multiline UITextField. That would actually solve the problem.

I'm no expert in UIKit, so if someone knows a better way to have a multiline text field with a keyboard done button that works post a comment. 

Wednesday, April 9, 2008

iPhone Dev Camp in NYC

If you are in the NYC area then this is a chance for you to learn the iPhone SDK with a group of NYC mobile developers. Signing up and registration is free. The event is on Saturday April 19th 2008 from 10AM-6PM at Polytechnic University in downtown Brooklyn.

Here are the details:

See you there!

Tuesday, April 8, 2008

First LBS Application

Last night I was pretty productive with the iPhone SDK. (Before my iPhone died)I wrote a quick LBS application. I'm really happy with how CoreLocation works. It's very simple to use and the possibilities are endless. Here's a screenshot (it's pretty simple though, only a UITextView):

I can't wait to see the type of apps people write with this API.

(You actually get a lot better precision in latitude and longitude from the API, i just took them out for this demo)

iPhone Pink Screen of DEATH

Latest Update: build 5A240d, beta 3 has been released!

I wake up this morning, and my iPhone is a brick! I have the "please connect to itunes" screen. Thinking I must have done something to cause this I started researching what could be wrong. I restore my phone, and nothing helps. Finally I give up and find out that my friend who is also an iPhone developer (different account) has the same exact problem as I do!

What is going on?! Please post comments if you have the same problem!

Other people experiencing problems:

UPDATE: I called the ADC customer service (800-633 2152), they told me that many people are also experiencing this problem. They just took my information down, and said they have techs working on the issue.

UPDATE: The Apple Forums deleted the post. According to the developer agreement you can't talk about this stuff in public

UPDATE: Just came back from Apple store. They are clueless to all of this, and they tried to install 1.1.4 and of course it failed. (Probably because it tries to flash the baseband and fails) I had to make an appointment to come back, and will hopefully get a replacement.

UPDATE: New iPhone Firmware is out! build 5A240d, beta 3. Please let us know how your install goes in the comments section!

Friday, April 4, 2008

iPhone Developer Program Acceptance

Finally! Got accepted to the iPhone Developer Program and I can install the buggy iPhone 2.0 Firmware. I believe I found out how you can guarantee acceptance when creating an account. I have 3 friends who chose the same option, and all got accepted while another few who didn't choose and are still waiting.

Basically, just make sure you specify that you are interested in development of Free Applications. It seems Apple wants the developers that will give their stuff away to get a heads up on development.

So if you've been really wanting to give your $99 to Apple, then create a new account and when you see the question that asks what type of applications you want to build select "Free".

Good luck!

Tuesday, April 1, 2008

Unity 3D Game Engine coming to iPhone

This is definitely very interesting: Unity is Coming to iPhone

iPhone's gaming capability rival's some portable gaming devices, and with the release of a 3D engine will only mean tons of different games on the iPhone. My only concern with iPhone gaming is that the controls aren't all that great. You can't really do much with the home button, and using "soft" controls (controls that are drawn on the screen) aren't very responsive.

Then there is the problem with battery usage. If you run some of the OpenGL ES samples on the iPhone for a while, your battery will start draining quickly.

Unfortunately even though the iPhone has all this capability I doubt it will have more than a "casual gamer" audience.

Rumors are that Apple will release a 3G version of the iPhone in June. This new iPhone will probably have a better battery, but I doubt it will be enough to play games and use the phone without recharging every 30 minutes.