Long story short, if your launch an action sheet in a view that lives in a UITabBarController, the “hit” box for the cancel button gets shifted in a VERY STUPID WAY!
The solution is to reference the view you’re displaying in by the UITabBarController like this:
I noticed this in some MonoTouch code that I wrote recently, but I think it makes sense across other languages as well. Let’s say you write a method that returns an incremented variable like this:
…where pVar = 10, the returned value will NOT be 11! The returned value will still be 10. If you want to return an incremented value for pVar, do the following:
private int MyAwesomeFunction(int pVar)
{ // coding magic return ++pVar; // or return pVar+1; }
Just a case of postfix vs prefix. In the previous example, the variable never gets incremented because the postfix operator would get evaluated after the line is processed, but that never happens because we’re returning the pVar. By flipping to a prefix operator, we guarantee that we evaluate the opperator against the variable before we return it.
It’s also worth mentioning that being a little verbose here is also good. Explicitly stating that you’re adding 1 to the variable (as displayed in the commented code) is the same number of characters and we eliminate the confusion over what’s getting returned.
I made a mistake while creating a GIT repos that I’m hoping I can save you from making. I made my first commit on a project and I realized that a bunch of files were getting in that shouldn’t be. I created a .gitignore file, but the issue kept happening on subsequent commits. As I learned later, you SHOULD create your .gitignore file first. However, if you forgot, this is how you fix it:
Keep your .gitignore file.
Clear your GIT cache. Don’t worry, this won’t delete any of your local files, just what GIT is tracking. git rm -r --cached .
Add everything in your project. Your .gitignore file will exclude what you want to ignore now and start tracking the good stuff. git add .
Commit your changes. git commit -m "Now my .gitignore file works correctly!"
Just a quick note about sass. Let’s say you had the following in /public/stylesheets/sass/foo.sass:
body
line-height:1.2em
h1
color:red
This would render a blank document for /public/stylesheets/foo.css. You won’t get an error about it, you’ll just get a blank document. Here’s the thing, when you’re declaring a CSS property, you MUST put a space after the colon. Failing to do so will just wind up in parsing errors on the sass side.
I couldn’t find these instructions in the iPhone Development portal, so I figured i’d share them with you here. Once you download the appropriate GM seed, here’s how it’s done (I’m assuming you’ve already designated your phone as a dev device.):
Make sure…
to downloaded correct GM Seed for your iPhone (1st Gen or 3G).
that your system and version of iTunes meet the requirements:
“You must be running Mac OS X v10.5.7 and iTunes 8.2 in order to install iPhone SDK 3.0 GM Seed and iPhone OS 3.0 GM Seed.”
“You must be running Mac OS X Snow Leopard Final Developer Preview (Build 10A380) and iTunes 8.2 in order to install the iPhone SDK 3.0 GM Seed for Snow Leopard and iPhone OS 3.0 GM Seed.”
Extract the firmware .ipsw to a folder.
Connect the iPhone to your computer.
Back up your phone!
Open iTunes and click Restore while holding the Shift key (for Windows) or Option key (for Mac).
Locate or browse to the firmware IPSW.
Wait for iTunes to unpackage and install the firmware.
OR you can just use Xcode…
Back up your phone!
Open Xcode
Open the Organizer (Window -> Organizer)
Flip the software version to “Choose…”
Select the GM Seed ipsw file
You should see a message that says something like “These changes will take effect when you restore you phone”
Click on the “Restore iPhone” button and watch the magic happen.
By backing up your phone ahead of time, you’ll be able to tell iTunes to put all of your crap back on it when the process is done. It’ll even try to preserve icon locations
This process sucks. Period. To get you through the suckage, I found this article with clear and useful steps. If you’re becoming an iPhone/iPod Touch developer, this is something you NEED to read. The article presents the steps of the deployment process in the best order possible to improve your chances at a successful push.
I came across this video from Brian Greenstone, the president and CEO of Pangea Software. You might remember him from such iPhone games as Enigmo, Cro-Mag Rally, or Bugdom 2.
He’s made a video answering “10,000 ft view” questions about iPhone game development that people who are new to the platform should hear. What he’s saying isn’t revolutionary, but it’s a lot of very good advice in 1 spot.