June28
I needed to search for files with a common bit of content on a host that I had connected to ssh.
This example searches all php files for ‘Search Term’, it search every sub directory from the current directory and prints out the name:
find . -name "*.php" -exec grep -l "Search Term" {} \;
July19
Unless you are building a custom UI (like a game) on the iPhone you probably spend a lot of time working with UITableVews.
I often found it difficult to find good simple examples of iPhone TableView code.
This first sample shows three different uses of UITableView:
1) Very basic table
2) Table that can be resorted.
3) Table that can be resorted with the first and last rows locked in place.
Click on the plain/grouped segment control to choose which style of table you want.
Table Sample
July7
Had a bit of an issue that took me a bit of head scratching. I had a UITableView which worked perfectly in iPhone API 2.2 but in 3.0 the insert/delete icons weren’t being displayed. Reworked and checked all the code but nothing worked.
It seems if you set the editing flag to YES when creating the tableViewCell’s, the insert/delete icon applied by the table delegate (editingStyleForRowAtIndexPath) isn’t displayed. Removing the call to cell.editing seems to fix the problem. This seems to be one of those things that is slightly different between iPhone OS 2.2 and 3.0.
June25
I had a UIButton inside a UITableViewCell and these were being rendered with a black background once I had upgraded the project to iPhone OS 3.0. These table cells were being loaded from their own NIB file.
To stop the black background I needed to set the background of the TableViewCell to white (like you do on most cells after the upgrade), but for the button I also needed to set the UIButton to have the “Clear Context Before Drawing” setting checked.
The background should still be transparent to allow the corners of grouped tables to be shown.
January14
I was receiving the following error while trying to run my unit tests from XCode:
Test Host –path to app– exited abnormally with code 138
For whatever reason, removing the tests from the Unit Tests target and re adding them to the target made the error go away. No other changes necessary.
December30
Here is the article that explains how to add unit testing to XCode 3 project.
http://developer.apple.com/mac/articles/tools/unittestingwithxcode3.html
If you search for unit testing with XCode you will find a lot of older articles pointing to XCode 2.x and how to install etc, etc. Now XCode 3 includes unit testing out of the box, so it is a lot simpler.
December28
Came across an interesting problem. Trying to get distributed objects to pass a common class between processes.
To avoid versioning issues I had the class in a shared location so that both client and server could use it.
On the server I was seeing a decodeRetainedObject: class ‘bleh’ not loaded error in the console log. Took a while to figure out, but XCode doesn’t automatically assign a class that are dragged and dropped into a project to the main target. The files simply needed to be assigned to the requisite target and everything works fine.
September23
Recently I did a presentation at the Melbourne Cocoahead, and recorded the screencast.
Here is the first part, a 24 minute demonstration of adding sparkle to a cocoa application.
The next 2 parts will hopefully be added in the next couple of weeks.
May17
Just another update NSTableView and creating it dynamically. If the NSTableView has its frame set then column resizing and scrolling seems to be screwed up.
By setting the frame of the scrollview and simply just calling init the NSTableView then the table seems to work correctly.
[tags]Cocoa[/tags]