看到一篇关于UIWebView 使用教程的文章,主要是细节方面的经验之谈,写的很不错,分享过来;原文见:7 tips for using UIWebView
For an IPhone app I have been building, I decided to use the UIWebView to render SVG files, instead of doing the vector rendering myself. I needed to have a way to read-in files generated from a vector authoring tool (Illustrator etc.) and after initially looking for an open-source SVG parsing/rendering engine of some sort, I decided on hosting the UIWebView itself instead and use the SVG rendering capability of WebKit. Another option could have been to read in PDF files as PDF is the default meta-file format for Quartz, but I needed programmatic access to each path drawn in the file and it was not apparent to me how I can do that once the PDF is rendered. (Any ideas on that is still welcome of course)
...
下面是google提供的天气预报接口的说明,在开发天气类程序的时候可以参考,提供了3种调用方式:
1.邮政编码法:(支持美国地区)
http://www.google.com/ig/api?hl=zh-cn&weather=94043
(94043 为 山景城, 美国加州 的邮政编码)
2.经纬度坐标作法:
http://www.google.com/ig/api?hl=zh-cn&weather=,,,30670000,104019996
(30670000,104019996 为 成都, 中国大陆 的经纬度坐标)
3.城市名称法:
http://www.google.com/ig/api?weather=Beijing
附:
支持的国家代码列表:http://www.google.com/ig/countries?output=xml&hl=zh-cn
(查询 Google 所支持的所有国家的代码,并以 zh-cn 简体中文显示)
支持的城市代码列表:
1 随机数的使用
- 头文件的引用
- #import <time.h>
- #import <mach/mach_time.h>
...
Tags: UINavigationController iPhone object-c navigation viewcontroller
原作者:Lin
After a lot of trial and mistakes, finally I kinda figured out how to make UINavigationController work…
1. initialise
To initialise:
1.1. with a default root controller:
self.controller = [mainController getInstance];
self.nav = [[UINavigationController alloc]
initWithRootViewController:self.controller];
...
Tags: UINavigationController 手机 程序 cocoa object-c
给UITableView增加一个好看的背景能为应用程序增色不少,并能促进app的销售,但是随便增加一个背景图片会史你的app更加丑陋。
错误的方式:
- //This method produces odd artifacts in the background image:
- ATableViewController *yourTableViewController = [[ATableViewController alloc] initWithStyle:UITableViewStyleGrouped];
...
Tags: UITableView 手机 程序
用过了NavigationBar的titleView和leftButtonItem,rightButtonItem后,我们也可以修改NavigationBar的backBarButtonItem。
用自定义一个backBarButtonItem用BarButtonItem声明,也可以用hidesBackButton来隐藏NavigationBar的返回按钮呢!
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeInfoLight];
...Tags: 手机 程序 开发 cocoa navigation
电话订票966688688或短信订票成功预订后:
西安:须于订票成功之时起至次日23:00以前,到市内各火车票代售点取票。
汉中、安康:须于订票成功之时起至次日17:00以前,到市内各代售点取票。
延安、宝鸡:须于订票成功之时起至次日16:00以前,到市内各代售点取票。
榆林:须于订票成功之时起至次日12:00以前,到榆林宾馆代售点取票。
渭南:须于订票成功之时起至次日17:00以前,到站北路代售点取票。地址:前进路南段19号
咸阳:须于订票成功之时起至次日18:30以前, 到咸阳市人民路代售点取票。地址:人民路医药大厦一层(北门口人民医院) 乐育路代售点 地址:乐育南路人民商场对面联运楼三层 彩虹桥代售点 地址:宝泉路1号彩虹桥新区大门
杨陵:须于订票成功之时起至次日23:00前,到杨陵车站取票。 (另外,以上各开通站可实现通订通取)
西安火车电话、短信订票方式
订票电话:96688688(24小时开通)
按1——订票须知
按2——普通订票
按3——动车订票
按4——简单订票
按5——学生订票
按6——取消订票
注:订票成功收取1元/张的信息费,不成功只收基本通话费。
短信平台:发送短信D到10626688
1.预定席位:发送短信“D#发车日期#车次#上车站#下车站#席别#票种#张数#身份证号码”到10626688。(例如:D#0121#T42#西安#北京西#硬卧#全#1#6101011983XXXX)
2.查询已定席位:发送短信“Z#发车日期#身份证号码”到10626688。
3.其他查询功能:发送短信“H”到10626688,获得相关业务免费帮助信息。
注:短信息同开通时间为早上8:00——22:00。短信订票预售期为3——10天。
西安市火车票代售点一览表
So… what I decided to do was read through his tutorials and basically construct the classes in a way that made sense to me – with a few tweaks along the way of course ![]()
The code in all its glory is below. What we have is essentially a totally generic gravityObject class that can be dropped into any view, and any number of times. What’s more, you actually initiate the object with a starting position and a PNG image (which for me, made more sense than drawing a circle on the screen – but you can change this part to suit your needs. So, without further ado:
在iPhone手机应用程序开发中, 应用iPhone重力感应器方面的教程或例子文章几乎没有,英文方面较为完整的也比较少,今天发现了一个应用重力感应做的游戏的完整的教程(Gravity Tutorial for iPhone),值得借鉴和参考。
总共分为5个部分讲解,下面是各章节的连接地址:
Gravity Tutorial for iPhone Part 1 Gravity Tutorial for iPhone Part 2


