随笔分类 -  iOS开发

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要://可通过苹果review+ (NSString*)getDeviceVersion{size_t size;sysctlbyname("hw.machine", NULL, &size, NULL, 0);char *machine = (char*)malloc(size);sysctlbyname("hw.machine", machine, &size, NULL, 0);NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEn 阅读全文
posted @ 2012-03-09 16:18 周宏伟 阅读(707) 评论(0) 推荐(0) 编辑
摘要:XCode 默认支持 Git 作为代码仓库,当我们新建一个仓库的时候,可以勾选创建默认仓库,只不过这个仓库是在本地的。本文介绍如何在 mac 机器上创建 Git 服务器,总体思路是:使用 gitosis 来简化创建过程,在用作服务器的机器上创建一个名为 git 的账户来创建 git 服务器,其他客户端通过 ssh 机制访问 git 服务器。 本文文档:点此下载 一,创建 git 账户 1,在用作服务器的机器 Server 上创建 git 账户。我们可以通过 System Preferences->accounts 来添加。在这里我添加一个 git 的 administrator 账户,a 阅读全文
posted @ 2012-03-08 14:50 周宏伟 阅读(1798) 评论(0) 推荐(0) 编辑
摘要:Introducing the iOS 5 FeastUser Interface Customization in iOS 5Beginning Storyboards in iOS 5 Part 1Beginning Storyboards in iOS 5 Part 2Beginning Turn-Based Gaming with iOS 5 Part 1Beginning Turn-Based Gaming with iOS 5 Part 2Working with JSON in iOS 5Beginning iCloud in iOS 5 Tutorial Part 1Begin 阅读全文
posted @ 2012-03-06 15:58 周宏伟 阅读(1442) 评论(0) 推荐(0) 编辑
摘要:很多时候我们的程序操作结构都是UITabBarController+UINavigationController,每个 UITabBarController item里面都有很多层的UINavigationController,而UITabBarController默认有一个事件就是双击 UITabBarController item时,会把这个item里的UINavigationController pop 到root,而我们有时不希望一下子就pop到了根视图,因为可能还会有一些逐层处理功能需要完成。这个时候如果想屏闭掉这个双击事件只留下单击切换标签 事件的话,就可以参考下面的方法重写UIT 阅读全文
posted @ 2012-03-06 14:42 周宏伟 阅读(1558) 评论(0) 推荐(0) 编辑
摘要:C函数要在程序中用到以下这些宏:void va_start( va_list arg_ptr, prev_param );type va_arg( va_list arg_ptr, type );void va_end( va_list arg_ptr );va在这里是variable-argument(可变参数)的意思.这些宏定义在stdarg.h中,所以用到可变参数的程序应该包含这个头文件.下面我们写一个简单的可变参数的函数,改函数至少有一个整数参数,第二个参数也是整数,是可选的.函数只是打印这两个参数的值.void simple_va_fun(int i, ...){va_list ar 阅读全文
posted @ 2012-03-06 10:44 周宏伟 阅读(388) 评论(0) 推荐(0) 编辑
摘要:typedefenum { UIBarButtonSystemItemDone, UIBarButtonSystemItemCancel, UIBarButtonSystemItemEdit, UIBarButtonSystemItemSave, UIBarButtonSystemItemAdd, UIBarButtonSystemItemFlexibleSpace, UIBarButtonSystemItemFixedSpace, UIBarButtonSystemItemCompose, UIBarButtonSystemItemReply, UIBarButton... 阅读全文
posted @ 2012-02-28 17:45 周宏伟 阅读(2216) 评论(0) 推荐(0) 编辑
摘要:#define kDocuments [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]BOOL isCreate = [[NSFileManager defaultManager] createDirectoryAtPath:[kDocuments stringByAppendingPathComponent:@"Event1"] withIntermediateDirectories:YES attributes:nil error:nil];[[NSFileMana... 阅读全文
posted @ 2012-02-27 14:48 周宏伟 阅读(1729) 评论(0) 推荐(0) 编辑
摘要:With the iOs SDK 4 now public and the advent of iAds just a few days away, I thought we’d celebrate with a tutorial on how to integrate iAd into your iPhone app!In this tutorial, not only will we show you how to get started with iAd, but we’ll also show you how to deal with some complex issues you m 阅读全文
posted @ 2012-01-11 17:49 周宏伟 阅读(473) 评论(0) 推荐(0) 编辑
摘要:Of all of the ways to persist data on the iPhone, Core Data is the best one to use for non-trivial data storage. It can reduce the memory overhead of your app, increase responsiveness, and save you from writing a lot of boilerplate code.However, the learning curve for Core Data can be quite large. T 阅读全文
posted @ 2012-01-10 18:22 周宏伟 阅读(751) 评论(0) 推荐(0) 编辑
摘要:0CGContextRef context = UIGraphicsGetCurrentContext(); 设置上下文1 CGContextMoveToPoint 开始画线2 CGContextAddLineToPoint 画直线4 CGContextAddEllipseInRect 画一椭圆4 CGContextSetLineCap 设置线条终点形状4 CGContextSetLineDash 画虚线4 CGContextAddRect 画一方框4 CGContextStrokeRect 指定矩形4 CGContextStrokeRectWithWidth 指定矩形线宽度4 CGConte 阅读全文
posted @ 2012-01-09 14:47 周宏伟 阅读(10864) 评论(0) 推荐(0) 编辑
摘要:官方地址:iOS App Programming Guide ->iCloud StorageiCloud支持两种应用存储:document storage:存储用户文档和应用数据到用户的iCloud账户key-value data storage:分享小量的非关键配置数据到应用的多个实例iCloud App的设计考虑首先需要确认的是采用document storage还是key-value data storage。document storage用于存储应用数据,要么是应用创建并私有管理的数据,要么是用户创建的数据。所有用户面对的数据都应该是document storage,例如用户 阅读全文
posted @ 2012-01-09 14:26 周宏伟 阅读(9217) 评论(0) 推荐(1) 编辑
摘要:1. 起步1.1 - 关于版本控制1.2 - Git 简史1.3 - Git 基础1.4 - 安装 Git1.5 - 初次运行 Git 前的配置1.6 - 获取帮助1.7 - 小结2. Git 基础2.1 - 取得项目的 Git 仓库2.2 - 记录每次更新到仓库2.3 - 查看提交历史2.4 - 撤消操作2.5 - 远程仓库的使用2.6 - 打标签2.7 - 技巧和窍门2.8 - 小结3. Git 分支3.1 - 何谓分支3.2 - 分支的新建与合并3.3 - 分支的管理3.4 - 利用分支进行开发的工作流程3.5 - 远程分支3.6 - 分支的衍合3.7 - 小结4. 服务器上的 Git4 阅读全文
posted @ 2012-01-08 13:05 周宏伟 阅读(267) 评论(0) 推荐(1) 编辑
摘要:1. NSData 与 NSStringNSData-> NSStringNSString*aString = [[NSStringalloc]initWithData:adataencoding:NSUTF8StringEncoding];NSString->NSDataNSString*aString =@"1234abcd";NSData*aData = [aStringdataUsingEncoding:NSUTF8StringEncoding];2.NSData与ByteNSData-> Byte数组NSString*testString =@& 阅读全文
posted @ 2012-01-04 15:47 周宏伟 阅读(530) 评论(0) 推荐(0) 编辑
摘要:#import <UIKit/UIKit.h>@interface UIView (Image)- (UIImage *) imageByRenderingView;@end#import "UIView+Image.h"#include <QuartzCore/QuartzCore.h>@implementation UIView (Image)- (UIImage *)imageByRenderingView{ UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInC 阅读全文
posted @ 2011-12-30 15:12 周宏伟 阅读(626) 评论(0) 推荐(0) 编辑
摘要:Introducing SeguesIt’s time to add more view controllers to our storyboard. We’re going to create a screen that allows users to add new players to the app.Drag a Bar Button Item into the right slot of the navigation bar on the Players screen. In the Attributes Inspector change its Identifier to Add 阅读全文
posted @ 2011-12-21 15:39 周宏伟 阅读(889) 评论(0) 推荐(1) 编辑
摘要:Storyboarding is an exciting new feature in iOS 5 that will save you a lot of time building user interfaces for your apps. To show you what a storyboard is, I’ll let a picture do the talking. This is the storyboard that we will be building in this tutorial:You may not know exactly yet what the app d 阅读全文
posted @ 2011-12-21 15:37 周宏伟 阅读(900) 评论(0) 推荐(1) 编辑
摘要:iOS4引入了一个新特性,支持代码块的使用, 这将从根本上改变你的编程方式。代码块是对C语言的一个扩展,因此在Objective-C中完全支持。如果你学过Ruby,Python或Lisp编程 语言,那么你肯定知道代码块的强大之处。简单的说,你可以通过代码块封装一组代码语句并将其当作一个对象。代码块的使用是一种新的编码风格,可以让你运用 自如的使用iOS4中新增API。我们先来看两个在iOS4中使用代码块的例子(你很有可能已经见过):view animations 和enumeration使用代码块的例子 第一个例子,假设我们创建一个纸牌游戏,需要展现纸牌被派发到玩家面前的动画效果。幸运的是通过 阅读全文
posted @ 2011-12-20 14:19 周宏伟 阅读(737) 评论(0) 推荐(0) 编辑
摘要:这套教程作为初学OpneGL ES的入门教程是相当不错的,推荐给大家 OpenGL ES 从零开始系列 之一 – 基本概念OpenGL ES 从零开始系列 之二 – 简单绘图概述OpenGL ES 从零开始系列 之三 – 透视OpenGL ES 从零开始系列 之四 – 光效OpenGL ES 从零开始系列 之五 – 材质OpenGL ES 从零开始系列 之六 – 纹理及纹理映射OpenGL ES 从零开始系列 之七 – 变换和矩阵OpenGL ES从零开始系列之四补遗 – setupView重写OpenGL ES 从零开始系列08:交叉存取顶点数据OpenGL ES 从零开始系列9a:动画基础 阅读全文
posted @ 2011-12-14 21:52 周宏伟 阅读(623) 评论(0) 推荐(0) 编辑
摘要:在 xcode4中,为了将一些比较独立的功能封装起来,或者多人同时开发时,需要将程序打包成静态库,但在xcode4中设置工作区、工程和静态库等遇到了 一系列问题,不知道是不是xcode的高版本中已经解决了这些问题?我用的是xcode4.0(4A304a), SDK是4.3。从网上能够查到的写的比较全面的使用和建立静态库的文章是CarbonFive的这篇文章。但我按照这个文章逐个试验后,发现几个地方跑不通,经过一番尝试,终于在我的机器上把详细的设置步骤跑通了。xcode4中的几个基本概念工作区(Workspace):在xcode4中引入了这个概念,能够把project统一管理起来,这功能在Vis 阅读全文
posted @ 2011-12-06 16:39 周宏伟 阅读(1239) 评论(0) 推荐(0) 编辑
摘要:转自cocoachina:http://www.cocoachina.com/bbs/read.php?tid=8466&keyword=%BE%B2%CC%AC%C0%E0%BF%E2(一)制作静态类库• ❑ 为方便讲解,更方便与初期代码测试,新建一个项目,StaticLibraryExample• ❑ 新建Target。 假设我们需要制作的静态类库名为 IMIBase. 右击Targets,添加新Target。选择Static Library, 名字为IMIBase • ❑ 添加类文件到IMIBase。在新建文件选项中注意,添加到的Target是IMIBase,而不是默认的Stat 阅读全文
posted @ 2011-11-30 12:42 周宏伟 阅读(2834) 评论(0) 推荐(2) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页