话说把iphone程序放到真机里调试,对于第一次,还真tmd麻烦。又是key,id,又是Provisioning Profiles的。在模拟器里调试还是很简单的。点一下Build and Go就ok了。

1. 获取Certificate,一次性工作。先在苹果的证书管理里面,生成一个证书文件,然后到http://developer.apple.com/iphone/manage/certificates/team/index.action这个页面里,添加一下刚才生成的证书,一分钟以后,会得到一个.cer文件的下载。双击它,就可以把certificate加入到keychain里面了。

2. 注册设备,很简单的。通过xcode的organization或者itunes都可以查看你的机器的udid.在上面那个页面里关联一下即可。

3. 生成appid,app id也要通过上面的页面生成,输入一个应用程序名,就会生成一个10位数的appid,bundle id最好是反向域名的形式,为了多个程序都能调试,可以写*.

4. 生成Provisioning Profiles。貌似,xcode主要也就是认这个东东,所以这个东西最重要,这个文件是根据app id,machine id,certificate,就是上面生成的那些东西生成的。上面的页面上有生成工具,一分钟之内生成完毕,下载下来,然后拖到organization或者直接拖到xcode上面即可。

5. 现在,把运行环境选成device,应该就可以运行了。8过,我在网上下载的31day的一个程序,运行不了,貌似总是提示info.plist有什么毛病。但是我自己昨天做的时钟hello world project,直接就运行在真机上了。

本文首发: http://www.iu1u.com 转载请注明
上面介绍的,这个页面里有各个步骤以及详细的视频解说,不过是鸟语的,可以参考http://developer.apple.com/iphone/videos/popupappids.action

Posted in iphone开发 at 12月 28th, 2008. No Comments.

介绍一点点object c的基本语法:

都说object c的语法是比较火星的,不掌握几个基本语法,一个hello world就可以把人看晕掉。偶就晕过的说。
掌握了这几个,看hello world应该绰绰有余了.

- (void) functionname… 表示对象的方法名

+ (void) functionname…表示类方法名,或者说静态方法名,类似与java中的static
没见过的Cocoa类,可以到http://developer.apple.com/documentation/Cocoa 查询,对于初学者,知根知底的查一下一个类的家底是很好的积累。
多个参数的调用方法比较火星一点:

-(void) setKids: (NSString *)myOldestKidName secondKid: (NSString *) mySecondOldestKidName thirdKid: (NSString *) myThirdOldestKidName;

具体可以参考CocoaChina的这篇文章 http://www.cocoachina.com/index.php/archives/cocoachina_122.html

 

Posted in iphone开发 at 12月 28th, 2008. No Comments.

其实,我的博客更新的不是那么平常,质量貌似也不是那么的高。但是刚刚随便写了一篇cocoa开发手机,刚才查nstimer文档的时候,第二个竟然就是偶的页面了,看的那个亲切啊!加油,继续折磨google crawler。

Posted in 未分类 at 12月 28th, 2008. No Comments.

参考:31Day的Day1: http://i.cniphone.com/space-7-do-blog-id-112.html
今天开始写iphone程序,看的31天iphone开发实例。第一个程序调通了。两个体会:

* 不要看中文版的,原版的表达很浅显,不需要多好的英语功底,中文版的反而词不达意,影响理解。不过原网站:appsamuck.com貌似被河蟹了(国内用户可以在这里查看:http://i.cniphone.com/space-7-do-blog-view-me.html
* 学会了NSTimer的用法,使用NSTimer时,那一堆参数必须全了,才好使,否则可能提示NSTimer may not respond to …
* 把倒计时改成了时钟,嘿嘿
第一天,继续加油

Posted in iphone开发 at 12月 28th, 2008. No Comments.

如何安装ubuntu:
http://wiki.ubuntu.org.cn/Install_Ubuntu_server

ubuntu 上装nginx:
http://www.linuxidc.com/Linux/2008-05/12962.htm

ubuntu中文论坛:
http://forum.ubuntu.org.cn

 

Posted in 未分类 at 12月 23rd, 2008. No Comments.

c盘空间本来就很紧张,最近频频发现c盘空间不足,清理了半天,也找不到什么东西可以清理的。今天仔细查看了一下,发现卡巴斯基的报告,竟然占了将近4个G的空间,C:\Documents and Settings\All Users\Application Data\Kaspersky Lab\AVP6\Report 下,有的报告文件,有三四百兆,块头真够大的,看了一下设置,默认设置是30天后删除,我干脆直接把记录报告选项关了!

Posted in 未分类 at 12月 21st, 2008. No Comments.

用链接做按钮的审核,总用<a href=”javascript:void(0)” onclick=”myfunc()”>

后来,发现myfunc()里,如果有location.href 或者 window.location.href的时候,发现这句话根本不工作,页面都不带跳转的。原来是void(0)搞得鬼,改成<a href=”javascript:myfunc()”>就哦了。

Posted in 未分类 at 12月 20th, 2008. No Comments.

FF和IE7已经直接支持透明的png图了,下面这个主要是解决IE6下透明PNG图片有灰底的

基本上就是利用css的DXImageTransform.Microsoft.AlphaImageLoader实现,不过实现方法不一样
第 1 种方法:定义一个样式,给某个div应用这个样式后,div的透明png背景图片自动透明了。(注意两处图片的路径写法不一样,本例中,icon_home.png图片与html文件在相同目录)

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>无标题文档</title>
<style type=”text/css”>
<!–
.qq {
height: 90px;
width: 90px;
background-image: url(icon_home.png)!important;/* FF IE7 */
background-repeat: no-repeat;

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’icon_home.png’); /* IE6 */
_ background-image: none; /* IE6 */
}
–>
</style>
</head>

<body>

<div class=”qq”></div>

</body>
</html>

 

第 2 种方法: 给img定义样式,页面上所有透明png即自动透明了。(这方法只对直接插入的图片有效,对背景图无效)注意,要准备一个透明的小图片transparent.gif,大小不限。必须放在和html相同的目录
请勿大量使用,否则会导致页面打开很慢!!!)
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>无标题文档</title>
<style type=”text/css”>
.mypng img {
azimuth: expression(
this.pngSet?this.pngSet=true:(this.nodeName == “IMG” && this.src.toLowerCase().indexOf(’.png’)>-1?(this.runtimeStyle.backgroundImage = “none”,
this.runtimeStyle.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’” + this.src + “‘, sizingMethod=’image’)”,
this.src = “transparent.gif”):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace(’url(”‘,”).replace(’”)’,”),
this.runtimeStyle.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’” + this.origBg + “‘, sizingMethod=’crop’)”,
this.runtimeStyle.backgroundImage = “none”)),this.pngSet=true);
}

</style>
</head>

<body>
换成你的png图片
<div class=”mypng”>
<img src=”icon_face_07.png” width=”30″ height=”30″ />
<img src=”icon_face_10.png” width=”30″ height=”30″ />
<img src=”icon_face_08.png” width=”30″ height=”30″ />
</div>
</body>
</html>
第 3 种方法:用JS实现,加上一段js代码后,所有插入的透明png自动透明了.(注意,这方法也是只对直接插入的图片有效,对背景图无效)

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>无标题文档</title>
<script language=”JavaScript”>
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split(”MSIE”)
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters))
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == “PNG”)
          {
             var imgID = (img.id) ? “id=’” + img.id + “‘ ” : “”
             var imgClass = (img.className) ? “class=’” + img.className + “‘ ” : “”
             var imgTitle = (img.title) ? “title=’” + img.title + “‘ ” : “title=’” + img.alt + “‘ ”
             var imgStyle = “display:inline-block;” + img.style.cssText
             if (img.align == “left”) imgStyle = “float:left;” + imgStyle
             if (img.align == “right”) imgStyle = “float:right;” + imgStyle
             if (img.parentElement.href) imgStyle = “cursor:hand;” + imgStyle
             var strNewHTML = “<span ” + imgID + imgClass + imgTitle
             + ” style=\”" + “width:” + img.width + “px; height:” + img.height + “px;” + imgStyle + “;”
             + “filter:progid:DXImageTransform.Microsoft.AlphaImageLoader”
             + “(src=\’” + img.src + “\’, sizingMethod=’scale’);\”></span>”
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }    
}
window.attachEvent(”onload”, correctPNG);
</script>
<style type=”text/css”>
<!–
body {
background-color: #9999CC;
}
–>
</style></head>

<body>
把图片换成你自己的图片
在插入投票后调用correctPNG函数即可
<img src=”img/icon_face_03.png” width=”30″ height=”30″ /><!–把图片换成你自己的图片 –>
<img src=”img/icon_face_05.png” width=”30″ height=”30″ />
<img src=”img/menu_title_over.png” width=”130″ height=”36″ />
</body>
</html>

Posted in 未分类 at 12月 17th, 2008. 1 Comment.

在博客法国网络观察,看到一篇文章列出了全球15个运营商的盈利排名。

  1. Telefonica 西班牙

    2007盈利额: 131,1亿美元

    2007成交额 : 893,6 亿美元

    员工数: 248 487

  2. AT&T 美国

    2007盈利额: 119,5亿美元

    2007成交额 : 1189,2亿美元

    员工数: 309 050

  3. China Mobile 中国移动

    2007盈利额: 119,1亿美元

    2007成交额 : 492,7亿美元

    员工数: 127 959

  4. France Télécom 法国电信

    2007盈利额: 68,4亿美元

    2007成交额 : 529,5亿美元

    员工数: 187 331

  5. BT Group 英国

    2007盈利额: 55,8亿美元

    2007成交额 : 400,3亿美元

    员工数: 106 200

    飘了一眼过去,对那一堆大数没有任何感觉,不过觉得China Mobile 中国移动其成交额和盈利额的比例是最大的。几乎达到4了,换句话说在移动消费了的钱,基本上大部分都落在移动裤兜里了。

Posted in iphone 资讯 at 12月 15th, 2008. No Comments.

允许外部连本机的哪些端口:TCP,UDP

IG_TCP_CPORTS:21,22,。。。
IG_UDP_CPORTS :..

允许外部连本机的哪些端口:TCP,UDP
EG_TCP_CPORTS
EG_UDP_CPORTS

Posted in 未分类 at 12月 13th, 2008. No Comments.