Luke Tupper Consulting

Luke Tupper Consulting Blog

Searching for files with content via Linux Command line

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" {} \;

Simple iPhone Table Example

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

Cocoa Quick Tip: Insert/Delete Icons not displaying on Table

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.

iPhone 3.0 UIButton in a UITableViewCell Weirdness

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.

Strange Cocoa Unit Testing Error

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.

posted under Cocoa, XCode | No Comments »

Adding unit tests to XCode 3 Project

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.

posted under Cocoa, XCode | No Comments »

decodeRetainedObject error when using Distributed Objects (DO)

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.

posted under Cocoa, MacOSX, XCode | No Comments »

Cocoaheads Sparkle Screencast

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.

posted under Cocoa | No Comments »

Code Coverage in XCode

August29

While working with the latest version of Duplicate Image Detector I was hoping to see the amount of code coverage in the unit tests.

I was happy to see that the code coverage tools are built into GCC, but disappointed to see that it isn’t the easiest to meaniful statistics added to part of the build process. There is a great post at SuperMegaUltraGroovy.Com listing how to get code coverage enabled for your unit tests.

The one step I couldn’t complete is the code that needs to be inserted into the the Run Script after your test case run code. The code was a bit managled by Safari/WordPress and even sorting that out I still had some issues.

Well after a bit of hacking around I found this code works pretty well (you will need to edit the framework name):


# Run the unit tests in this test bundle.
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
# Run gcov on the framework getting tested
if [ "${CONFIGURATION}" = 'Test' ];
then
FRAMEWORK_NAME=DID-V2.0
FRAMEWORK_OBJ_DIR=${OBJROOT}/${FRAMEWORK_NAME}.build/${CONFIGURATION}/${FRAMEWORK_NAME}.build/Objects-normal/${NATIVE_ARCH}
mkdir -p coverage
pushd coverage
echo ${OBJROOT}
echo ${FRAMEWORK_OBJ_DIR}
find ${FRAMEWORK_OBJ_DIR} -name *.o -exec gcov -b -o ${FRAMEWORK_OBJ_DIR} {} \;
popd
fi

This will produce the following information after the unit tests when you run your test:


File '/Users/tupps/Development/LTConsult/svn/DID/v2/ImageMatchManagement.m'
Lines executed:70.00% of 40
Branches executed:100.00% of 34
Taken at least once:64.71% of 34
Calls executed:86.21% of 29
/Users/tupps/Development/LTConsult/svn/DID/v2/ImageMatchManagement.m:creating 'ImageMatchManagement.m.gcov'

I hope this helps get a few people closer to running unit tests and looking at their code coverage on the mac. A nice utility like shark would be fantastic for working through these files and all of the information that is exported.
ass master
antique school desk
uma thurman nude
nude marykate and ashley olsen
ass to mouth jenna jameson
her first pet sex
granny grandson fucking
acer usb tablet boot
horny baby sitter
men swallow cum
xxx ass
old bitches tits
naked indian men
south korean tranny bars
chinese oriental dresses pics
glamour ladies nylons
hot latina porn
wet breasts
butt rub
oriental girls gallery
antique double sink bathroom vanities
tan stockings sex
mom daughter lesbian sex
women celebrities exposed
free gay military men
bare bottom spanking clips
nude family beach
hot hairy
paris hilton caught without panties
hentai hot toon sex
gothic adult webcam
dogs having sex with men
exploited black teen passwords
guys wearing nylons and panties
extreme hairy
large butt plugs
elephant penis
ebony lesbo
booty barker nextel cup crew chief
orthopedic foundation for animals
adult chat operator
bypass school firewall
1001 ways to eat my jizz
dd breasts
horny xxx
thong flashing gallery
smooth shaved
lesbian hentai dildo
moms fucking their sons
dog houses for large dogs
k-12 student safety
bree olsen interracial videos
studs cumming gay
girls who spread legs
gothic teen jizz
dick licking
tattoo ideas for girls
hottie college coed
granny topless
filipina manila sex
waningmoon gothic personals
hermione granger naked
enormous ebony dick
extreme geek
bi husband xxx
porn movie galleries
blond sex clips
panties fuck
hot blonde office sex
hidden boy cam
old hairy men
ebony tranny gape
black bitch galleries
ebony female ejaculation
girls on cam
free sexcams no e-mail
beach teen bikini pics
anti gag cream
olsen twincest
celebrity uncensored
military sexual assault
fuck dog
fingering cunts
nun sex
revolving grooming table dogs
birthday cake clip art
ebony huge tits
stocking porn galleries
free nurse video porn
girl suck a dick
articles on red heads
sexy grannies older women
micro bikinis model galleries
how to make penis bigger
secretary masturbation
skinny white pussy
twinks for cash tommy
girlfriends licking pussy ffm
milk nipple
masterbation parties
8 year old girl birthday party
12 year old girl in thongs
big tit chat rooms free
free webcam streaming chat
hairy pussy close up
the simpsons sex
office desk layout designs
gothic femdom
commercial large lazy susans
young nude boys
horny hitchhikers
mens cocks
old fuck
deep throat porn
bisexual femdom
zac efron nude
men shave body hair
hermione granger porn
free granny with girl gallery
heather deep throat
tranny pics
little girls
my friends hot mom porn site
big tits blowjobs
ghetto ass
her first huge dick
hot gothic nudes
mega cocks
penis pain
hot gothic nudes
double blower
big ass anal
brunettes in panties
female bodybuilder sex
free gangbang video
teen skinny dip
african tranny
sexy brunette sex
horny old man
naked horny babes
sexcam jasmin
hot brunette with huge titts
bi sex videos
fatty bbw
tight pussy close up
ass to mouth girls
lg m5500c-ba
tranny anal dildo
brazil tshirt womens
tera patrick cum
ebony girls fucking baseball bats
milf latinas
granny ass
hot sexy legs
home made porn facial
bbw gallery
girl masterbating in shower
yahh bitch yahh
flexible bondage
sexiest legs
tight long skirts
penis enormous
live cams adult
drunk blowjob
but im a cheerleader
symptoms of bi polar disorder
boot leg movies
kids fuck
kelly clarkson naked
harley chicks
big hairy cock
playboys book of lingerie
gay gag cum
free blowjob videos
enormous buttplug
gothic whores
black cum facials
milk my jizz
gangbang squad
extreme activities
gay giants
jack osbourne paparazzi pics
bestiality brazil
flex body building magazine
licking tit
fucking in stockings
bbw porn videos
1987 to 1003 ford mustang big block engine swap
first time deep throat
porn paysite passwords
pussy & ass closeups
free bbw pussy
tranny dick
granny fucks
teacher upskirt
cartoons fucking
gay ass fuck amateur free
clitoris closeup
funny nipples
cock pussy
gay sucking big cocks
dripping hairy pussy
grandma cum
xxx picture mary kay & ashley olsen
pussy on cam
fuck it eamon
hot gothic teen girls
yamaha rhino engine swap
filipina nudity
14 year old average penis size
horny old man
www. chicks wiyh dicks
interracial payperview porn
tattoos tribal art
big tits bbw porn
fake nude pictures of the olsen twins
student study team forms
petite lesbians oriental
big juicy butts
xtra large grannies

posted under Cocoa, Duplicate Image Detector, MacOSX, Useful Code | Comments Off

Dynamic NSTableView Part II

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]

« Older Entries