自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 资源 (1)
  • 收藏
  • 关注

转载 解决XCODE 4下调用相机、通讯录等是英文的问题

转自:http://www.cocoachina.com/bbs/read.php?tid=91761修改Info.plist文件Localization native development region 为china和修改工程Info下Localizations增加个china即可(见下图)。

2013-07-20 11:59:09 1115

原创 Fone Monkey的配置

最近项目需要用到Fone Monkey,在实际配置中按照官方教程的步骤走下来遇到2个问题,下面分享一下:1. 当加入SenTestingKit.framework后编译,提示 ld: framework not found SenTestingKit解决这个问题,我们需要设置Target -> building setting -> framework search paths,加入以下两

2013-07-12 14:07:17 1706

转载 appledoc, Objective-C的文档生成工具

还没有机会实践,先记录下来吧,有机会试用一下。原帖地址: http://blog.devtang.com/blog/2012/02/01/use-appledoc-to-generate-xcode-doc/前言做项目的人多了,就需要文档了。今天开始尝试写一些项目文档。但是就源代码来说,文档最好和源码在一起,这样更新起来更加方便和顺手。象Java语言本身就自带javad

2013-07-01 14:04:36 1028

转载 iOS架构概述

iOS自下至上可以分为四层:Core OS,Core Services,Media,Cocoa Touch。Core OS是用FreeBSD和Mach所改写的Darwin, 是开源、符合POSIX标准的一个Unix核心。这一层提供了整个iPhone OS的一些基础功能,比如:硬件驱动, 内存管理,程序管理,线程管理(POSIX),文件系统,网络(BSD Socket),以及标准输入输出等等

2013-06-24 16:53:28 2818

转载 sleep(), usleep()和[NSThread sleepForTimeInterval:]

引用一段stackoverflow上的回答sleep(3) is a posix standard library method that attempts to suspend the calling thread for the amount of time specified in seconds. usleep(3) does the same, except it takes

2013-06-20 14:55:43 6313

原创 iOS振动检测不出来

从代码中的反馈就是motionEnded等方法没有被调用,检查以下几点1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中是否设置了application.applicationSupportsShakeToEdit =

2013-06-09 10:26:07 1245

原创 AFJSONRequestOperation报错Expected content type

错误类似于"Expected content type {( "text/javascript", "application/json", "text/json" )}, got text/html"这是没有指定请求期望的字符集,需要调用[AFJSONRequestOperation addAcceptableContentTypes:[NSSetsetWithObject

2013-06-07 16:54:07 2114

原创 could not change executable permissions on the application

出现这个问题,是因为设备上已经存在相同bundle id的App了(但已安装的这个App和要安装的App证书不同)。将已有的App删除或者更改新App的bundle id就可以解决了。

2013-05-28 15:40:55 1128

原创 App内打开App Store

完成该功能需要使用SKStoreProductViewController,只支持iOS 6,直接看代码吧。if(NSClassFromString(@"SKStoreProductViewController")) {// Checks for iOS 6 feature.        SKStoreProductViewController *storeController =

2013-05-21 16:00:39 1024

原创 Xcode设置去掉图标高亮效果

在项目的plist文件中设置

2013-05-16 10:20:15 2155

原创 重载(Overload)与重写(Override)

重写(覆盖)一般用于子类在继承父类时,重写(重新实现)父类中的方法,其规则如下:1. 重写方法的参数列表必须完全与被重写的方法的相同,否则不能称其为重写而是重载2. 重写方法的访问修饰符一定要大于被重写方法的访问修饰符3. 重写的方法的返回值必须和被重写的方法的返回一致4. 重写的方法所抛出的异常必须和被重写方法的所抛出的异常一致,或者是其子类5. 被重写的方法不能为p

2013-01-24 15:28:24 935

原创 iOS UIKit类图

2013-01-10 09:45:55 8086

原创 利用Google Map获得某点的经纬度

1. 搜索目标2.  右键单击目的地并选择居中3. 在浏览器地址栏输入 javascript:void(prompt('',gApplication.getMap().getCenter()));

2013-01-04 18:33:33 1021

原创 iPhone调用短信、邮件等系统功能时界面显示中文的方法

在项目的plist中:1. Localization native development region 选择 china2.Localized resources can be mixed 选择 YES;如果没有,需手动添加

2012-11-28 11:41:45 860

原创 通过UIView获得UIViewController

如存在UIView *view,可以通过UIViewController *controller = [viewnextResponder]获得。如果view没有controller,则会返回superview。

2012-11-27 14:12:44 696

原创 IBoutlet和IBAction

见下文You might be wondering just what IBAction and IBOutlet are. Are they part of the Objective-C language? Nope. They’re good old-fashioned C pre-processor macros. If you go into the AppKit.frame

2012-10-25 11:14:15 1189

转载 objectForKey和valueForKey的区别

见下文objectForKey: is an NSDictionary method. An NSDictionary is a collection class similar to an NSArray, except instead of using indexes, it uses keys to differentiate between items. A key is an

2012-10-23 10:06:57 1653

原创 通过已有nib/xib创建UIView

见代码NSArray *arr = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:nil options:nil];UIView *view = [[arr objectAtIndex:0] retain];[self.view addSubview:view];

2012-10-15 11:34:05 1509

原创 iPhone应用中加入评分功能

可通过构造如下的URL来使得程序直接跳转到App Store中的评价页面NSString *str = [NSString stringWithFormat: @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d", a

2012-09-17 14:09:20 1674

原创 iOS中Categories和Extensions的简单对比

Categories可以在没有类源代码的情况下为类添加新的方法可以把类的实现分散到多个文件中可以重载已有方法,会影响到类及其子类Extensions可以在类的实现中加入新的方法而不需要在对应的interface中声明使编译器可以更好的验证私有接口(会报warning)使property对外可以readonly,对内可以read write

2012-09-11 17:55:17 843

转载 GCD教程(四):完结

完结篇,原帖地址:http://www.dreamingwish.com/dream-2012/gcd-four-the-the-odds-and-ends.htmlDispatch Queue挂起dispatch queue可以被挂起和恢复。使用 dispatch_suspend函数来挂起,使用  dispatch_resume 函数来恢复。这两个函数的行为是如你所愿的。另外

2012-09-06 14:31:03 1128

转载 GCD教程(三):Dispatch Sources

接上一篇,原帖地址:http://www.dreamingwish.com/dream-2012/intro-to-grand-central-dispatch-part-iii-the-dispatch-sources.html何为Dispatch Sources简单来说,dispatch source是一个监视某些类型事件的对象。当这些事件发生时,它自动将一个block放入

2012-09-06 14:29:49 1084

转载 GCD教程(二):多核心的性能

接上一篇,原帖地址:http://www.dreamingwish.com/dream-2012/of-of-of-performance-of-of-of-of-of-of-of-gcd-introduced-ba-the-multi-core.html概念为了在单一进程中充分发挥多核的优势,我们有必要使用多线程技术(我们没必要去提多进程,这玩意儿和GCD没关系)。在低层,G

2012-09-06 14:28:28 1242

转载 GCD教程(一):基本概念

在网上看到关于GCD的一个很不错的教程,这里做一下转载原帖地址:http://www.dreamingwish.com/dream-2012/of-of-of-of-gcd-introduced-1-basic-concepts-in-and-the-dispatch-queue.html什么是GCD?Grand Central Dispatch或者GCD,是一套低层API

2012-09-06 14:27:09 2858

原创 iOS中Categories和Extensions的区别

简单的将,通过Categories(分类)即使在没有某个类源代码的情况下,也可以为这个类添加新的方法声明。而新方法的实现可以在另外的文件中。而通过Extensions(扩展)可以很好的解决两个问题。1.使编辑器可以更好的验证类的私有方法,参照下面代码:// .m@interface BaseClass()- (void)doSomethingPrivate;@end@

2012-09-04 14:22:42 4390

转载 NSLog输出格式

•    %@       对象    •    %d, %i   整数    •    %u        无符整形    •    %f         浮点/双字    •    %x, %X  二进制整数    •    %o        八进制整数    •    %zu      size_t    •    %p        指针    •

2012-09-03 22:50:01 577

原创 iOS中的@synthesize var=_var

直接看代码@interface MyWindow : NSWindow {}@property(readwrite) BOOL capturing;@endand then in the implementation use@synthesize capturing;上面这段代码在32位环境中会报错,因为我们并未声明变量 capturing而在64位环境中并不会报错,因为

2012-08-29 15:33:54 1606

原创 PHP + APC + Drupal

1. 安装APC,下载APC源代码     phpize - 生成configure文件    ./configure --with-php-config=/root/to/php/bin/php-config    make; make install2. 编辑php.ini,例如    extension=apc.so    apc.enabled=1    apc

2012-03-06 11:40:44 951

原创 Drupal启用Clean Url

1. 启用Apache的mod_rewrite模块    编辑httpd.conf,解除注释 LoadModule rewrite_module modules/mod_rewrite.so    如果在编译apache时没有生成 mod_rewrite.so, 执行: apxs -c mod_rewrite.c; apxs -a -i -n mod_rewrite mod_rewrite

2012-03-05 14:51:21 769

转载 install guest additions on debian

转自:http://virtualbox.wordpress.com/doc/installing-guest-additions-on-debian/Follow these steps to install the Guest Additions on your Debian virtual machine:Login as root;Update your APT d

2011-12-13 00:33:58 629

原创 Android中ListView多次调用getView

在开发中遇到一个问题,listview的getView()方法会莫名其妙的执行多次,原来是listview的布局文件的问题: android:layout_width="fill_parent"android:layout_height="wrap_content" />将android:layout_height="wrap_content"修改成:android:layout_

2011-10-20 16:02:37 3983

原创 drupal7 services中selectNodes的调用方法

url http://192.168.10.28/drupal/?q=get_node/tax/selectNodesheaders: Content-type: application/x-www-form-urlencodedbody: tid = 1

2011-10-19 11:43:53 913

原创 drupal7 services

1. 安装Services模块,依赖CTools和OAuth2. 新建endpoint, 编辑资源3. url http://ip/drupal/?q=endpoint_name/res, eg http://192.168.10.28/drupal/?q=note/te

2011-10-17 14:23:02 890

原创 android textview一行显示

textview中设置属性android:ellipsize="end“                     // 省略号在末尾 marquee为跑马灯android:singleLine="true"即可

2011-10-10 02:32:41 5019

原创 android listview的高度

item的布局文件中加入下面代码即可android:minHeight="?android:attr/listPreferredItemHeight"

2011-10-08 13:51:47 994

原创 drupal7安装与删除

安装:1. 下载drupal压缩包解压到 /var/www2. 从 http://localize.drupal.org/ 下载需要到的语言包(.po)并移动到 drupal-7.8/profiles/standard/translations3. cp drupal

2011-09-29 15:35:01 2745

转载 替换数据流-ADS

<br />这篇文章是根据H. Carvey的The Dark Side of NTFS (Microsoft’s Scarlet Letter)<br />翻译的,可以自由转载,但请保持译者和来源以及文章的完整性.<br />简介:微软的平台不断在增加.公司用的服务器和桌面操作系统运行的一般是winNT和win2000,而家庭用户和学生用的系统一般是winXP.这些平台是很受欢迎的并且被大范围的使用.可是使用这些操作系统的用户和管理员却对NTFS文件系统的某个特性知道的很少,那就是”交换数据流”(alte

2011-02-02 16:36:00 939

原创 MinGW + GLUT环境搭建

<br />1.  在此下载glut<br /> <br />2. 解压文件,将glut.h复制到 MinGW/include<br /> <br />3. 将libglut32win.a复制到 MinGW/lib<br /> <br />4. 将glut32.dll复制到 Windows/system32<br /> <br />5. 在代码中加入以下宏定义<br /><br />#define _STDCALL_SUPPORTED <br /><br />#define _M_IX86 <br /><b

2010-08-15 10:39:00 1434 1

winglut.zip

包含 glut.h glut32.dll libglut32win.a

2010-08-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除