First tip, inside UITableView, if you need to change the background of a row, you need to do so inside the willDisplayCell delegate instead of cellForRowAtIndexPath:
Second tip, if you need to organize a group of files inside a subfolder under Resources, make sure you drag the folder from the Finder into Resources inside Xcode, and ALSO make sure you check this option:
Friday, June 22, 2012
Monday, June 18, 2012
To the Device and Beyond?
Just deployed my code to my phone, didn't expect it to work right away but wished to have some pleasant surprises, no, there were issues more than one, and it made me scratching my head wondering.
As you could see on the device the background image for the game board was not rendered as in the simulator, also the image for one of the button was not rendered either........
After digging around, I found the issues:
As you could see on the device the background image for the game board was not rendered as in the simulator, also the image for one of the button was not rendered either........
After digging around, I found the issues:
| 1)the iPhone simulator is NOT case sensitive but the device is case senitive |
| 2)earlier I used initWithFormat to get the path to the background image, it worked in the simulator but failed on the device, I replaced that with stringByAppendingPathComponent, and now it is working both in the simulator and on the device. |
Thursday, June 14, 2012
initWithContentsOfURL and encoding
In the pictures below you could see the Chinese Characters were not displayed properly, it turned out I had to specify encoding NSUTF8StringEncoding when calling the method initWithContentsOfURL.
And the default encoding if no encoding specified? ISO-8859-1 encoding...........
Friday, June 8, 2012
Performed static analysis of my objective-c code and fixed reported issues
Memory leak is the biggest headache for developers coding for iOS 3 and iOS4 devices, after using the static analysis tool of Xcode to identify the possible issues and fixing them, I found the tool to be quite helpful in improving your code. I reduced the possible issues from 110 items to just 22.
And about half of these actually from the RegexKitLite regular expression library I used, and after looking closer, the potential issues reported there were already looked into and could be "safely ignored".
This process not only improves your code quality and builds you confidence, also helps you understand the iOS memory management better.
Subscribe to:
Posts (Atom)




