Fork me on GitHub
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 125 下一页

2012年5月15日

摘要: 判断 iPhone 是否插入了 SIM 卡,可以参考苹果官网的 systemconfigure framework 教程,将下面的代码复制到头文件extern NSString* const kCTSMSMessageReceivedNotification;extern NSString* const kCTSMSMessageReplaceReceivedNotification;extern NSString* const kCTSIMSupportSIMStatusNotInserted;extern NSString* const kCTSIMSupportSIMStatusRead 阅读全文
posted @ 2012-05-15 20:19 pengyingh 阅读(451) 评论(0) 推荐(0)
摘要: -(void)drawRect:(CGRect)rect {NSString* imageName = [[NSString alloc]initWithFormat:@”b%d.png”,m_Index];UIImage* aImage = [UIImage imageNamed:imageName];[imageName release];int width = aImage.size.width;int height = aImage.size.height;CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();CGCont 阅读全文
posted @ 2012-05-15 20:19 pengyingh 阅读(282) 评论(0) 推荐(0)
摘要: 发现很多砸几百万、几千万甚至上亿的投入做游戏失败的,大都是没有认真做好DEMO。DEMO可是个好东西,做游戏想赚钱、想省钱,非它不可。但它既区别于小说的提纲,也区别于摘要。那DEMO到底是什么呢?从预算来说,开发DEMO的预算不要超过整体预算的30%;如果DEMO的预算超过了30%,估计开发者、项目经理从心里就没有勇气砍掉这个项目了,他们经常会说:大钱都花了,索性把后面的小钱也花了,万一赚钱呢!万一是个好产品呢。自己骗自己,自己给自己编美好的未来了。这30%着实是心理防线。从时间上来说,开发DEMO的时间不要超过2个月,也不要超过整个项目时间的20%。手机游戏开发团队,不少公司都是很小型的公司 阅读全文
posted @ 2012-05-15 20:17 pengyingh 阅读(406) 评论(0) 推荐(0)
摘要: UUID含义是通用唯一识别码 (Universally Unique Identifier),这 是一个软件建构的标准,也是被开源软件基金会 (Open Software Foundation, OSF) 的组织应用在分布式计算环境(Distributed Computing Environment, DCE) 领域的一部份。UUID 的目的,是让分布式系统中的所有元素,都能有唯一的辨识资讯,而不需要透过中央控制端来做辨识资讯的指定。如此一来,每个人都可以建立不与其它人冲突的 UUID。在这样的情况下,就不需考虑数据库建立时的名称重复问题。目前最广泛应用的 UUID,即是微软的 Microso 阅读全文
posted @ 2012-05-15 20:16 pengyingh 阅读(2899) 评论(1) 推荐(1)
摘要: 在 iPhone 应用或者是游戏的开发过程中,对声音的支持是必不可少的。在我做过的几个应用中,每个都涉及到音效,所以在这里做个简单的归纳,很多都是引用自《iPhone Application Programming Guide》(需要有 Apple ID 才能打开链接),加了一些实际使用的经验。iPhone OS 主要提供以下了几种播放音频的方法:System Sound ServicesAVAudioPlayer 类Audio Queue ServicesOpenAL1. System Sound ServicesSystem Sound Services 是最底层也是最简单的声音播放服务, 阅读全文
posted @ 2012-05-15 20:14 pengyingh 阅读(234) 评论(0) 推荐(0)
摘要: @implementationNSString (PasteboardGoodies)- (void) sendToPasteboard{[[NSPasteboardgeneralPasteboard]declareTypes: [NSArrayarrayWithObject:NSStringPboardType]owner:nil];[[NSPasteboardgeneralPasteboard]setString:selfforType:NSStringPboardType];}// sendToPasteboard@end// PasteboardGoodiesNSPasteboard 阅读全文
posted @ 2012-05-15 20:12 pengyingh 阅读(516) 评论(0) 推荐(0)
摘要: <script type=”text/javascript”>function OnLoad(){document.documentElement.style.webkitTouchCallout = “none”;}</script> 阅读全文
posted @ 2012-05-15 20:12 pengyingh 阅读(184) 评论(0) 推荐(0)
摘要: AirPrint 是苹果 iOS 系统自带的无线打印功能,阅读、新闻等类型的应用内如能集成 AirPrint,会给消费者带来极大便利。CocoaChina 会员分享了在应用里加入 AirPrint 功能的方法,希望下面的代码能为相关应用的开发者们节省时间。NSString *path = [[NSBundle mainBundle] pathForResource:@”test” ofType:@”jpg”];NSData *data = [NSData dataWithContentsOfFile: path];UIPrintInteractionController *pic = [UIP 阅读全文
posted @ 2012-05-15 20:10 pengyingh 阅读(349) 评论(0) 推荐(0)
摘要: UIAccelerometer *accelerometer =[UIAccelerometer sharedAccelerometer];accelerometer.delegate =self;accelerometer.updateInterval =1.0f/60.0f;- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{if(fabs(acceleration.x)>2.0||fabs(acceleration.y)>2.0| 阅读全文
posted @ 2012-05-15 20:09 pengyingh 阅读(162) 评论(0) 推荐(0)
摘要: (1.给图层添加背景图片:myView.layer.contents = (id)[UIImage imageNamed:@"view_BG.png"].CGImage;(2.将图层的边框设置为圆脚myWebView.layer.cornerRadius = 8;myWebView.layer.masksToBounds = YES;(3.给图层添加一个有色边框myWebView.layer.borderWidth = 5;myWebView.layer.borderColor = [[UIColor colorWithRed:0.52 green:0.09 blue:0. 阅读全文
posted @ 2012-05-15 20:08 pengyingh 阅读(177) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 125 下一页

导航