Tuesday, August 30, 2011

XCode 4 says "requires Max OS X 10.6.6" when tried to install on Lion

You got to be kidding me... Tried to install XCode 4 on Lion (10.7.1), and it says "iPhone SDK requires Max OS X 10.6.6 - to install the iOS SDK you must quit the installer and upgrade to Max OS X 10.6.6"...Yeah right, luckily Apple now offers XCode 4.1 for Lion free - I guess this is another incentive to encourage all developers to upgrade to Lion?Only trouble is, another huge 4GB download...

MacFuse doesn't work on OS X Lion??

Just received my new 13" MacBook Pro - running OS X 10.7.1 Lion. Was installing NTFS-3G plus MacFuse on it to access my NTFS external UBS drives. But I keep getting this error as shown below: "dyld: Library not loaded: /usr/local/lib/libfuse.2.dylib Reference from: /usr/local/bin/ntfs-3g Reason: image not found"When I then check the status of MacFuse it says "MacFUSE does not appear to be installed" and can't check for Updates.Did some search and found this post saying:MacFUSE: The original MacFUSE...

Friday, August 26, 2011

Neon Label Test

Saw quite a lot of games using fancy label/text/drawings with nice "neon" effect. Searched on the net for a while and found 2 sites ( Cocoanetics and stackoverflow.com info by Brad Larson) which have some useful information. So I combined the 2, plus some colour info from Visibone, and I was able get some nice labels with Neon effect working.But I think that's not enough. Mainly because the effect of these neon labels will also depend on the background colour/image underneath.  So I modified...

Improved ListAllFonts

I was playing around with the "ListAllFonts" project I had before, but noticed a problem: although it's quite handy to have al the font names available, it's not much use unless I can visually see what each font looks like. Changing the font of a label one font name at a time is just too dumb...Also added 2 new things just learned: block-code and UIScrollView.A simple block-code to show font and automatically increase the "y" value is as below. It accepts 3 parameters: the view (UIScrollView), the...

Wednesday, August 24, 2011

Don't always need an UILabel to display a NSString

I always thought to display a NSString on a view, you need to create a UILabel. But from Apple's "iOS Development Guide", looks like this might not be the case. The "Hello World" example in Page 23 of the guide shows some code (Listing 1-1) as below to display a NSString directly using "drawAtPoint", which is quite interesting...- (void)drawRect:(CGRect) rect {     NSString *hello = @"Hello, World!";     CGPoint location = CGPointMake(10, 20);     UIFont *font = [UIFont systemFontOfSize:24.0];     [[UIColor whiteColor] set];  ...

Saturday, August 20, 2011

Better way to handle switching between multiple view controllers?

Was looking at this sample code from Apple called "AlternateViews" which demonstrates the switching between 2 View Controllers when the device orientation changes.I found a few interesting things about the code:1. The "PortraitViewController" is loaded first, it then loads the "LandscapeViewController" in the viewDidLoad() of "PortraitViewController".2. There's this new piece of code which I never seen before (as below) using NSNotificationCenter, which sets to call "orientationChanged" method when the orientation changed. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter...

Friday, August 19, 2011

Minutes to Midnight - rotatable version

The 3rd and 4th project with AppsAmuck wasn't that interesting. So I updated the "Minutes to Midnight" project with rotation capability. Now the display automatically adjusts it's location when the device rotated. Source code available below.Code for Rotatable Minutes to Midni...

Thursday, August 18, 2011

Following AppsAmuck's 31 Example Applications

Saw this site called AppsAmuck which provides 31 example applications. Just started yesterday and up to the 2nd one now. It's quite interesting as the site provides detail information plus the source code - although it's a bit out of date.The 1st example is about showing a clock counting down to midnight. As shown below, the code can't compile in XCode 4, after some research on the net I got it working and added another clock on top - one showing the current time, the other showing the count down....

Wednesday, August 17, 2011

List out all font names

Thanks to Ajnaware’s Weblog I was able to list out all the font names, as shown in the attached screen dump. You should have a try too![Update] Please see this new post which shows improved version that also displays each font in scrollable view.    // List all fonts on iPhone    NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];    NSArray *fontNames;    NSInteger indFamily, indFont;    for (indFamily=0;...

Sunday, August 14, 2011

Open Source Game: Simple Ball Bouncing Game Ver 2

I expanded the simple ball bouncing game a bit. It now has a few more functions:-added game pause function-added left/right direction movement, toggle between up/left-right movement with direction button-starts with 1 ball, get extra ball every 100 points (max 5 balls)-added device rotation handling-added top score recording using application preferenceA simple video of the game is below:Also learned some new skills, this is my first project with proper device rotation handling (using empty NIB...

Thursday, August 11, 2011

Open Source Game: Simple Ball Bouncing Game

Based on YouTube video http://www.youtube.com/watch?v=iGwZoowB-6Y&feature=related by TheEagle1100, I learned quite a lot of new things and created this new simple ball bouncing game: the timer, the game state, the way to move the balls, move the platform down, setup the scores, ...etc.As shown in screen dump below, there's a few balls bouncing up and down, getting scores on every bounce. When the balls bounced above top 1/4 of the screen, the green platforms moved down and more new ones...

Wednesday, August 10, 2011

When can we have XCode Running on iPhone/iPad?

Was thinking, now that the iPhone/iPad devices are getting more powerful in every generation, wonder how long will it take before Apple release a "portable/mobile" version of XCode that runs on iPhone/iPad? In that case, we can all do development on the same device, how cool is that?...

Saturday, August 6, 2011

Can't have array in @property?

Was following this You Tube Video "Making a simple iPhone game, part 2 by TheEagle1100 (DBaird Software), but I tried to do it in slightly different way. Instead of declaring 5 UIImageView calling them "*platform1" to "*platform5", I used an array to save the effort of duplicating.However when I put in declaration for @property as below, as shown in screen dump above I get 2 errors. 1st about "Property cannot have array or function type 'UIImageView *[5]", the 2nd one says "Property...

Friday, August 5, 2011

Why my NIB-less projects won't auto-rotate?

Found a problem with the NIB-less projects I have created so far. For some unknown reason, it won't auto-rotate? That is, if I create a simple NIB-less project with only 1 button and 1 label, and then rotate the simulator to either direction, then even if I change the "shouldAutorotateToInterfaceOrientation" as below to always return "YES", it won't move at all?- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{    // Return YES for supported orientations    //return (interfaceOrientation == UIInterfaceOrientationPortrait);   ...

Page 1 of 66712345Next