January 27th, 2014
The following tip is for TextWrangler users of version 4.5.6 and greater. If you want XML files look nice in TextWrangler follow these instructions:
- create a new script file, e.g. TidyXml.sh with following content
XMLLINT_INDENT=$'\t' xmllint --format --encode utf-8 -
and save it under
/Users/[UserFolder]/Library/Application Support/TextWrangler/Text Filters
That’s all! now just open your XML file, got to menu Text->Apply Text Filter and choose your script file.
December 27th, 2013
Find below the way Apple recommends to implement singleton in your code. In your .h file you should declare a static method:
Afterwards go to your .m file and implement the declared static method:
// Create a singelton using GCD (thread safe!)
static YourClassName * sharedInstance = nil;
static dispatch_once_t onceToken = 0;
sharedInstance = [[YourClassName alloc] init];
This is a thread safe implementation of the singleton pattern! I always used Java-like singleton implementation in the past, but then I found the described way.
December 23rd, 2013
This weekend I set up a website for a shipbroker company don-wave. To keep the things simple I decided to make use of the popular cms wordpress. Read the rest of this entry »
October 30th, 2013
What I really miss about Objective-C is the clear concept of functions(properties) visibility like the way it is realized in JAVA – static/public/protected/private. Today I found out the way of using “private” properties/functions in your Objective-C class. In your .m file just define the interface with the property you need (ARC):
@interface MyClass ()
@property (nonatomic, strong) NSArray *someArray;
// your implementation
Note: “nowadays” it is possible to omit the @synthesize line
October 8th, 2013
I have had already experience of setting up Jenkins for automated builds of iOS projects. However, in cases I had before, there was a Linux or Windows machine with installed Jenkins server. A dedicated Mac machine was added as Jenkins-node. Read the rest of this entry »
April 30th, 2013
I came across an interesting post about splash screens for Android apps. The main thesis of the article is that the Android apps does not need splash screen in most of the cases at. The splash screen is a port of the concept from iOS. For Android apps its just additional overhead that does not make really sense. Here is the link to the article.
April 29th, 2013
I use my eclipse for MAC (version Juno “Eclipse Java EE IDE for Web Developers”) for both J2EE projects and Android development. I don’t know what’s wrong, but sometime I experience weird eclipse behavior on loading my Android workspace(s). Eclipse just freezes when loading a workspace, showing only the splash screen. After google search, one finds quite quickly a work around, but I never found out, what the real cause for the problem is.
So, the solution is to change to your workspace folder. Afterwards go to
.metadata -> .plugins-> org.eclipse.e4.workbench
and delete workbench.xmi file. Then restart eclipse. Your workspace should be loaded now. Unfortunately your workspace settings like LogCat, Console are lost. You should set your environment again.