Posts Tagged ‘mac’

Issues with IntelliJ IDEA 9 M1 (Maia) in Linux and OSX (build #10372)

Unlike the godess, IntelliJ 9 M1 isn't shy about being buggy

Unlike the godess, IntelliJ 9 M1 isn't shy about being buggy

IntelliJ 9 (codenamed Maia) looks promising with lots and lots of great features. There seems to be an endless list of newly supported technologies, tweaks, and usability features.

Maia has been superb in Mac OSX Snow Leopard. Unfortunately, my Ubuntu 9.04 desktop is an entirely different story.

A big feature of Maia that I’m looking forward to is background file indexing. It sounds like a great idea, be able to edit and browse projects instantly while you wait for the indexing to finish. The catch is advanced browsing and editing features are not available until after indexing finishes.

Both in OSX and Linux I ran into issues with the background file indexing.

Comparatively, my experience with background file indexing with OSX was less severe, so I’ll start there. Like when I normally load a project with IntelliJ, a loading dialog pops up with a status bar and I can watch the name of files zoom by as they’re being indexed. Unlike previous versions of Intellij, there’s a button to put the indexing into the background.

Instantly I click the button. I mean, why waste time, right? Unfortunately browsing was completely unusable with everything being sloooooow. In IntelliJ’s defense, I have only booted up IntelliJ once so far on my Mac. And this is a pre-release. (I usually just leave IntelliJ running and beyond this, everything has been wonderful).

The issues with Ubuntu were a bit more troubling. To my surprise, the background indexing did not bring the UI to a screeching halt like it did on my Mac. What I wasn’t prepared for was worse.

With background indexing appearing to run smooth, I was pumped to get the most out of the new feature. Immediately I dug into the directory with the project’s JSPs. Annoyingly every minute or so the listing of files would disappear and be rebuilt. After a few times, I realized the background indexing would finish then start right back up in a minute.

This restarting of the background indexing went on for about a half hour I was busy with some activities that didn’t require a PC so I just let it do its thing hoping it would stop. Of course the constant indexing did not stop. The directory listing did not stop reloading.

Giving up, I restarted IntelliJ and everything loaded just fine every time since.

The next two problems showed up intermittently in Linux.

Firstly, on more than one occasion and seemingly randomly. If I had two files in two tabs, selecting the unselected tab would do nothing except show that the second tab was selected. The displayed file contents would not show up. I could open up additional files and switch to them just fine, but I could never get the other file’s contents to show up even then. The tab issue occurred on more than one occasion. Closing and reopening the misbehaving tabs fixed the issue each time.

The next issue was more troubling: I would simply lose the ability to edit files. I could type until I was blue in the face and text would not show up. The inability to edit files cropped up frequently and was not solvable without restarting IntelliJ.

After poking around at IntelliJ IDEA 9 M1 on Linux I gave up and reverted back to using IntelliJ 8. I am still successfully using IntelliJ 9 M1 on OSX, but my usage has been very light lately due to other events.

I sincerely hope IntelliJ 9 gets to a stable point. IntelliJ is such a time saver I really do not want to program in Java with anything less feature full.

Bottom line: The new features in Maia are wonderful. Feel free to download and use Maia, just don’t expect to be throwing out IntelliJ 8 just yet.

 

Saving app data with the iPhone SDK and Cocoa is easy with NSUserDefaults

A quick look at NSUserDefaults suggests saving app data with Cocoa and the iPhone SDK is easy. I haven’t gotten much of a chance to use it so there might be some gotchas.

To store nonsensitive data using NSUserDefaults is as easy as a couple of lines of code:

[objc]
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:usernameTextField.text forKey:@"username"];
[defaults synchronize];
[/objc]

The last line is particularly important as it actually saves the data to disk.

Retrieving data is equally as easy:

[objc]
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog([defaults objectForKey:@"username"]);
[/objc]

NOTE: Using NSUserDefaults is a really bad idea for sensitive data like passwords. A significantly safer solution would be to use the iPhone’s keychain. Apple has an example found in GenericKeychain.

The API can be difficult to understand and cumbersome to use. Luckily, there is a solution for that from Buzz Anderson and it can be found on github.

 

Unexpected error 0xE800003A application verification failed

I’ve been spending time lately learning to use Objective-C and the iPhone API.  While trying to deploy a sample iPhone app through Xcode, I ran into a pesky error message.

Your mobile device has encountered an unexpected error (0xE800003A) during the install.

Application verification failed.

Configuring Xcode is a quick and easy two step process (assuming you’ve setup the appropriate certificates, provisioning, etc. with Apple):

  1. Set your bundle identifier in Info.plist (This is your APP ID excluding the Bundle Seed ID).
  2. Set the project code signing identity to your provisioning profile.

That’s it!

Of course, I ran into three different errors when trying to deploy it to my iPhone:

  1. Bundle identifier is incorrect (typo or bundle seed ID was included).
  2. Incorrect provisioning profile was selected.
  3. Clean and rebuild and deploy (Build > Clean All Targets).

The first two problems where easy to resolve, but the third item was definitely tricky.  Who would have thought you’d need to clean the project after making that sort of change?