Blog

  • The flaws of using isset()

    I am starting to really dislike the PHP function isset().  Today, I was working on a registration system in CakePHP and my password validation was not working.  If I left the password field blank and clicked submit, it would come back with other errors, but then the password would come back populated with a long string – a hashed version of an empty string!

    After some investigation, I discovered that the AuthComponent in CakePHP was doing an isset() check on the username and password fields.  If isset() returned true for both, it would hash the password. (more…)

  • Reset UINavigationController

    The following is a neat little trick to reset your navigation controller when it is integrated with UITabBarController.

    The following code will pop the navigation controller up when the user clicks on your tab bar item.  I’ll begin by showing a bit of code that needs to take place.  It’s going to be a quick overview of this to focus on the main function to reset the navigation controller. (more…)

  • Scroll a UIWebView

    I struggled with this one for quite a while.  I kept searching and searching, all I could find was forums and no one seemed to have an answer!

    Well, if you’re here, don’t worry, I have the answer you have been looking.  Let me show you how to make a UIWebView scrollable for your iPhone application. (more…)

  • Transparent UIWebView

    The other day I was working on my iPhone application.  In the application I have a view.  This view creates a UIWebView.  I then proceed to load content from a webpage into the web view.

    This works great.  I was then tasked with adding a bit of style to the view similar to how you perform a transparent background with CSS.

    I started by creating all of the style in the webpage, but I quickly realized that this was causing the load to be a lot slower.  Instead I had to integrate the design into the view and simply display the content from the webpage in the design.

    This was going pretty well until the webpage sat like a big white blob on top of my nice image.  I couldn’t let this be and had to find a solution, luckily it wasn’t to complicated. (more…)

  • A friendly framework reminder

    Quite often at work, I find myself reminding my team members to be sure to ALWAYS utilize the framework to it’s fullest.  Just because you are unsure how to do something or have never done it before in the framework, does NOT mean that it cannot be done!

    I use to have this thinking as well.  I would curse and curse, I’ve done this a 100 times, why is it so difficult to do with this framework!

    Once I calmed down, I would Google it or look around the documentation and pretty quickly discover how to accomplish it using the framework.  9 times out of 10, I found that it was actually extremely easy to implement.  Not only that, 7 or 8 times out of 10, it would actually save me time!  If it didn’t the first time, it certainly always saved me a lot more the next time. (more…)