exclude iPad support for app

1. When creating, the project in the latest version of Xcode, it allows you to choose the device family. Don’t select universal or ipod. Just select iPhone. 2. An alterntive is in the application’s Build Settings change the Targeted Device Family to iPhone, instead of iPhone/iPad.

use GDataXML to parse xml in Xcode5

There are many ways in iOS to parse xml including the one inside the SDK. However I am not a big fan of that. Most people still tends to use third party library to do this for convenience. GDataXML is a library from google. which you can download from: http://code.google.com/p/gdata-objectivec-client/source/browse/trunk/Source/XMLSupport/ After you get these two files,…

PrepareForSegue Tableview issue

I have a segue : When i click and go to the detail view, it always display the first element in the array/dic. The problem is i forgot to connect the IBOutlet to the tableview. The same as this POST.

tableview with storyboard in xcode5

The identifier in the defined in the cellForRowAtIndexPath method MUST be the same as what is specified in the storyboard’s prototype cells’s indentifier . This takes me almost half a day to figure out. Otherwise the table will load the data, but all the other config you did in the storyboard will not be valid…

Safari open link in new tab

I was search for a safari extension so that I can open new link by drag and drop. However nothing was found. While i was going through the safari settings, it shows that Command+click will open it in a new tab. This could be an temporary substitute for the extension i was looking for. Also…

Mac Keyboard symbols

I am always having difficulty in remembering the keyboard symbol like shift ,alt and ctrl in Mac.

native app and web app in mobile

Features of mobile device  small screen touch screen always with user always with connected more sensor(camera, gps…) better technology: comparing with desktop, it fully support HMTL5 and CSS5 by using webkit, except windows phone(upgrade to IE9 recently) Native app: pros : performance access local resources like camera gps. distributed by app store channel one click purchase…

把osx自带字典加入中文词典

硬盘里的dicUnify放了几个月,结果删了,最终还是没有装,今天上课无聊发现osx的词典还是只能英英翻译。于是google。 发现只要下载词典放在Library下的Dictionaries下面就可以了,相当方便。 这是地址之一吧:http://ishare.iask.sina.com.cn/f/12637036.html 终于可以在finder里直接翻译了~~

OSX 查看系统文件夹

Mac OS X中有很多系统隐藏的信息文件, 一般在Finder中都是看不到,也修改不了的. 但通过在”终端”中输入命令, 就可以在Finder中显示出来: defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder 其实就是修改系统的一个设置, 再重启Finder 同样的道理可以让Finder不显示隐藏文件: defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder 如果知道文件或文件夹的路径, Command+shift+G , 可以点击去查看. View Hidden Files and Folders in an ‘Open’ or ‘Save’ Dialog Box Launch the application you wish to use to edit or view the hidden file. Select ‘Open’…

tableview 中增加drill down

为了让显示patent信息的table能够drill down已显示全title,以及日后可能要增加显示specification。废了一天时间,还没有搞定,最后在Ngon的帮助的勉强出来了~ 由于这个project是基于switchViewController的,所以要加drill down这种navigationController的功能的话就显得相当麻烦,因为没有一个global的navigationController来控制~ 于是要在switchViewController中switch的时候,装入一个navigationController,然后这个navigationController再pushView给一个viewController,这个controller可以是那个table,在点击的那个响应方法中就可以用这个navigationController来push新的view,然后这个navigationController也会帮助管理view的push以及pop。 不过由于是hack的,design没有事先做好,结果每五六次就会crash,而且是一个相当于constant的变量值会变,并且是在没有call 任何mutator的情况下!崩溃了简直! objective-c呀,,,真麻烦~ ps:为了显示完成的title名,下午曲线救国了一下,就是让一个行自动调整高度,先cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;  并且让设置cell的textLabel的numberOfLines属性为0,加入以下方法: – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; PatentIssued *patentIssued = [[[iServeAppDelegate sharedAppDelegate] retrievePatentIssues]  objectAtIndex:row]; NSString *cellText =[[[patentIssued.patentId stringByAppendingString:@” – “] stringByAppendingString:patentIssued.patentTitle] stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; UIFont *cellFont = [UIFont fontWithName:@”Helvetica” size:17.0]; CGSize constraintSize = CGSizeMake(280.0f, MAXFLOAT); CGSize labelSize = [cellText sizeWithFont:cellFont…

其他controller中让table reload

今天做seekPatent,要在一个controller里更新数据,然后在另外的viewController中更新table。发现在objective-c中用observer模式还是很容易的: 1. Using notifications: 存储完数据并且方法返回之前,发布notification. Something like this: //[[NSNotificationCenter defaultCenter] postNotificationName:@”DataSaved” object:nil]; 在处理table的controller中, implement – (void) dataSaved:(NSNotification *)notification{    [self.tableView reloadData];} 在它的 viewDidLoad 方法中注册notification: [[NSNotificationCenter defaultCenter] addObserver:self                                selector:@selector(dataSaved:)                         …