2011年1月2日星期日

UIViewController loadView

When alloc a UIViewController with nib name, it does not load the view yet, so we need to call loadView to load its view.

Such as

_playStationController = [[PlayStationViewController alloc] initWithNibName:@"PlayStationViewController"
bundle:nil];
[_playStationController loadView];

Otherwise when access the IBOutlet in the view, it may returns nil

Create a new git repository for your iphone project

Here is how I create a repository for my iphone project.
  1. After create a project in xcode, open a terminal and go to the project directory
  2. type "git init", it should create an empty .git repository
  3. create a .gitignore file, the file has following contents
# xcode noise
build/*
*.pbxuser
*.mode1v3

# old skool
.svn

# osx noise
.DS_Store
profile
4. Create a .gitattributes file
*.pbxproj -crlf -diff -merge

5. type "git add ." to add all files in repository
6. type "git commit -m 'initail commit'" to commit all changes.


Now your repository is ready!

BTW: I should learn how to use this blog :(

reference: http://shanesbrain.net/2008/7/9/using-xcode-with-git

2010年6月8日星期二

Visibroker on Weblogic

I need to deploy an application on WebLogic, and this application acts as a visibroker client. But when connect it always has this error,

java.lang.Error: org.omg.CORBA.INITIALIZE: Could not initialize Invalid typecode kind org.omg.CORBA.TCKind@9bbe66 vmcid: 0x0 minor code: 0 completed: No

This is because WebLogic uses its own ORB. Configure the following system properties, it will be OK:

-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB
-Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORBSingleton

Using putty tunneling to bypass firewall

移除选定内容的格式设置During my developement, I need to open a SMSC simulator on my own PC, and let a server to connect to this simulator, but there is a firewall block the server open a connection to my PC. Here is how to use putty to configure it.

My simulator listens to port 8003, so configure putty tunnel like the following figure,

Select the type as Remote. Enter source port as 8003(you can also choose other port), and enter Destination as localhost:8003. Now the server also opens port 8003, so now you can direct all traffic to the server localhost, and the tunnel will direct the traffic to my own PC.

Attention: in the above configuration, the option "Local ports accept connections from other ports" must be checked.

2008年11月30日星期日

cassis的美景

是在La ciota上班时下班一个同事开车带我们去的,当时那种美景让我很震撼,去卢浮宫也没有这感觉,看来还是自然美景比较吸引我