Global stats from W3C (browser, OS, screen resolution)
but the US has a heavier IE proportion:
US browser stats
Monday, May 14, 2012
Tuesday, April 17, 2012
SVN command line and @2x images
You can't escape it, adding and removing @2x images from the command line don't work. Thanks to a post by behaving on StackOverflow for the solution:
You need to add a "@" sign in the end to get SVN to process the file.
For example, if you had a file called foo@2x.png which you want to add to SVN, you would type:
svn add foo@2x.png@
If you have lots of files with the "@" symbol in their name that you want to process in a batch (i.e. use * wildcard), you can do something like this in OS X Terminal:
find . -name "*@*" | xargs -I % svn add %@
The above command will use the find utility to list out each file with @ in its filename and then pipe the path to the file to SVN using XARGS. XARGS will replace each occurrence of % with the path and append the special "@" at the end of the filename so that SVN will accept it.
Sunday, April 15, 2012
Blocks don't retain variables
I recently had user reports of The Rebus Show crashing in iOS 5.1. The app had been tested and even put through a beta program. The intermittent crash happened because the blocks don't retain variables, in this case myObj was intermittently released by iOS:
runBlockAfterDelay(delay, ^{
[myObj myMethod];
myObj = nil;
});
The fix was simple:
__block MyObj* temp = myObj;
runBlockAfterDelay(delay, ^{
[temp myMethod];
temp = nil;
});
Tracking down this issue was difficult because it was intermittent, crash reports didn't symbolicate this code, ARC was responsible for the object's release, and because the crash manifested itself in an apparently unrelated event handler myMethod was responsible for removing. Fortunately, I noticed the event handler's owner address was different than the current object's address.
Thursday, January 26, 2012
Positioning UIViews
UIView+position is the most useful category I've come across - so good, I add it to my project's .pch so it's always available. Author Tyler Neylon made this available via a Apache 2 license. You can do all sorts of neat stuff e.g.
view1.frameY = view2.frameBottom
view1.frameWidth = view2.frameHeight
view1.frameY = view2.frameBottom
view1.frameWidth = view2.frameHeight
Xcode: How to turn off ARC on individual files
- Click on the Project.
- Click on the target.
- Select build phases tab.
- Select the multiple files in which you want to turn off ARC.
- Press ENTER / Hit Enter key
- Type “-fno-objc-arc” ( without quotes)
For more info: Source Link by Neon Spark
Wednesday, January 25, 2012
Adding a NIB view at runtime
// Add MyView.xib to a UIView, in IB associate MyView.xib and the MyView class
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil];
MyView* o = [nibViews objectAtIndex:0];
[self addSubview:o];
Wednesday, January 18, 2012
Showing invisible files and folders on the Mac
In Terminal:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
to hide:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
killall Finder
Subscribe to:
Posts (Atom)