CakePHP Basics Tutorial – Part 3

Overview

In this tutorial I will show you how to create a login form which validates the user with the database and do some basic security to redirect people who try to access a protected page. I’ll go over Flash messages to show the user some information which will last for one request.

Continue reading CakePHP Basics Tutorial – Part 3

Unhide the Library folder on (Mountain) Lion

Problem

Since OSX 10.7 Apple has decided to hide the ~/Library folder from your users directory. When you are using the iPhone Simulator or other development applications, you spend a fair amount navigating around in the Library. So if you are tired of using command+shift+G all the time, you can easily unhide the Library folder forever and ever, without showing all the hidden files on your system!

Continue reading Unhide the Library folder on (Mountain) Lion

CakePHP Basics Tutorial – Part 2

Overview

In this tutorial I’ll show you in about 30 minutes how to create a html form with the built-in FormHelper of CakePHP which automatically links up to the database fields to see what kind of input field should be generated.  Further on we also check out the built-in validation options and how we can save our submitted form data to the database. And at the end I’ll explain how you can use CakePHP’s Model callback functions to put in our custom code before a CakePHP action.

Continue reading CakePHP Basics Tutorial – Part 2

CakePHP Basics Tutorial – Part 1

Overview

In this tutorial I’ll show you in about 30 minutes how to do a basic setup of CakePHP and read some data from the database without writing any SQL!  This will be an i-don’t-know-how-many-parts tutorial, but I’ll try to add every week a few until the basics are covered!

Continue reading CakePHP Basics Tutorial – Part 1

Generate code with CakePHP’s cake bake command

Overview

In this tutorial I’ll show you in 25 minutes how to generate some basic CRUD functionality into your CakePHP website without writing a single line of code! This can be done by using the console which you get for free with CakePHP.
This is a great way to get up’n’running in minutes and start from what CakePHP has generated for you.

Continue reading Generate code with CakePHP’s cake bake command

Declaration of beforeSave() should be compatible with Model::beforeSave( $options = array() )

I’ve just upgraded my servers to PHP 5.4 and got this error when loading a project.

Declaration of MyModelName::beforeSave() should be compatible with Model::beforeSave( $options = array() )

There seems to be a problem when using PHP 5.4 and CakePHP 2.1 which results in this error.  Since PHP 5.4 E_ALL and E_STRICT are now combined and with a default CakePHP installation error reporting is set to E_ALL & ~E_DEPRECATED!

Luckily it is really easy to fix!

Continue reading Declaration of beforeSave() should be compatible with Model::beforeSave( $options = array() )

Installing unsigned apps on OSX 10.8 Mountain Lion

Problem

If you have installed Apple’s new operating system (Mountain Lion), you will notice that you won’t be able to install software which hasn’t been signed by an identified developer or downloaded via the Mac App Store (this is also known as Gatekeeper).  They do this to counter the growing amount of malware that is bugging OSX the last couple of months.  As the option is turned on by default, you have to find where to shut it off to download unsigned content (especially older apps).

Solution

Go to System Preferences < Security & Privacy < Tab ‘General’
You will see ‘Allow applications downloaded from’ greyed out, so first authenticate by clicking on the little padlock at the bottom left of the window.
Select ‘Anywhere’ instead of ‘Mac App Store and identified developers’

You’re done 🙂

iCapital v1.5 released

This week a new version of iCapital got released in the App Store. It was my guinea pig app to learn myself Objective-C this summer when I broke my foot. It was an excellent learning app, because it covered a lot of new concepts which I had to tackle:

  1. Core Data
  2. Migrating data on updates
  3. Memory management
  4. Retina support
  5. Game Center

Now, 8 months later, I took a look at how I left my code behind in my repository and I thought it was a good thing to rewrite the whole app as I now have a much better understanding of the language.  Since then I created a new game Boring Meeting OXO, an iPad app (in a private store, but you can take a look how it works here, this was still in a development phase), and a few personal apps.  As I feel myself comfortable with the language now, I hope I can release many new apps soon (one is coming pretty soon :-)!

As with every update, I give away some promo codes you can redeem via the App Store. So for the quick readers, here are 10 promo codes:

AW66MN7A6H3E
EPYRKHW6N6NF
E4MEXAMHTFKM
MYR4JFYPWY6L
FHLN4TJA97EP
MEH34K39HR4K
7KN6MMYAAPW7
NF6KMNNYH399
HTFKEX49JEP4
L3T9FWLPYXLX

I hope you have fun with it!

Debug IOS applications with Charles Web Proxy

When you are doing (naughty) stuff with the Internet, Charles Web Proxy is probably the most valuable thing a developer could have!

Normally I just use Firebug’s Net panel to see what my request/responses are, but since I’ve discovered Charles it took debugging and inspection to a whole new level. Especially now I can hook it up to inspect the traffic sent to and from my iPhone. Continue reading Debug IOS applications with Charles Web Proxy

Archiving your iPhone app and icon dimensions don’t meet the size requirements

I’ve just archived an update for iCapital and I stumbled upon a weird warning.

It said the following

icon dimensions (0 x 0) don’t meet the size requirements.  The icon file must be 57×57 pixels, in .png format

I double checked my build settings and my app icons had the right dimensions.  When I searched for the warning on Google, there were a lot of other people who also had the issue since they updated to XCode 4.2 and OSX 10.7.3.

Luckily it’s really easy to fix the issue. You just need to set ‘Compress PNG files’ to NO in your Build Settings and re-archive your app!