自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 资源 (11)
  • 收藏
  • 关注

原创 添加启动图片

启动图片,即splash,当应用尚未完全启动完成时显示的图片直接添加一个名为Default.png的图片即可,Retina的图片名为[email protected],注意Default的第一个字母D要大写.

2011-10-01 00:42:33 1868

原创 添加应用图标

info.plist中:如果只需要一个图片,修改Icon file即可.如果需要一组图片,则需创建Icon files,数组,挨个添加需要的图片.

2011-10-01 00:38:27 1556

原创 国际化

应用名称国际化创建对应语言的InfoPlist.strings文件加入以下内容:CFBundleDisplayName = "应用程序的名字";源代码中的国际化genstrings *.m -o zh-Hans.lproj带递归查找所有子目录的find ./ -name *.m | xargs genstrings -o en.lproj

2011-10-01 00:30:23 1461

原创 adblock csdn

csdn.net##div#headercsdn.net##iframe[name="iframeaa1"] csdn.net##div#_popop_msg_containercsdn.net##div#poet_containercsdn.net##.im_p

2011-10-01 00:27:04 1676

原创 xcode .gitignore

# Xcode.DS_Storebuild/*.pbxuser!default.pbxuser*.mode1v3!default.mode1v3*.mode2v3!default.mode2v3*.perspectivev3!default.perspectivev3*.xcworkspace!default.xcworkspacexcuserd

2011-09-30 23:27:11 1966

原创 UIImagePickerController中文界面

默认是英文的,怎么变成中文界面呢?其实很简单,只要创建一个空的中文(zh-Hans)InfoPlist.strings就可以了,这样系统会知道当前应用是国际化的,就会根据当前的语言环境选择相应的界面.

2011-09-30 23:05:52 4328 1

原创 开启雪豹 64位模式

检查CPU是否支持64位:ioreg -l -p IODeviceTree | grep firmware-abi终端会返回“EFI32″ or “EFI64.”如果你觉得每次开机都要按住“6”和“4”很麻烦, 那还有个一劳永逸的方法:打开 /Library/Preferences/SystemConfiguration/com.apple.Boot.plist把Kernel Flags替换成Kernel Flagsarch=x86_64一切就OK了

2011-06-02 23:11:00 1871

原创 XCode: ld waning boost consthas different visibility (default)

<br />编译boost库应用时产生大量诸如ld: warning: boost::xxx consthas different visibility (default) in之类的警告,虽不影响,但比较闹心。<br />解决办法:<br />在Targets(注意是Targets不是最顶的project)下找到当前应用设置,搜索 Symbols hidden by Default, 这个选项现在应该是打钩状态,uncheck之, clean, build,这下世界清净了。<br /> <br />另有说

2011-03-11 11:41:00 2100

原创 asio

<br /><br />Create an io_service:<br />  asio::io_service io_service;<br />and some work to stop its run() function from exiting if it has nothing else to do:<br />  asio::io_service::work work(io_service);<br />Start some worker threads:<br />  boost::

2011-03-10 12:18:00 1854

原创 qt for android

先下载android sdk, 注意下载下来的sdk还不能马上用,还需要在线安装,不同平台windows,linux,macosx,需要下载相应的版本。下载android ndk, 这是qt 需要的c++环境, 不同平台windows,linux,macosx,需要下载相应的版本。下载android-lighthouse:http://gitorious.org/~taipan/qt/android-lighthouse,git clone git://gitorious.org/~taipan/qt/an

2011-02-01 17:15:00 7480 2

原创 STL容器

list<br />插入:Does not affect the validity of iterators and references. If an exception is thrown there are no effects.<br />插入复杂度:Insertion of a single element into a list takes constant time and exactly one call to the copy constructor of T. Insertion of

2011-01-29 22:21:00 1984

原创 XCode: Base SDK Missing

<br />从xcode里提取一个例子程序,准备编译运行,但是XCode报错 Base SDK Missing<br />这也没啥,设上就行了呗,project info->general->Base SDK for all configurations,选择最新的iOS SDK.<br />好,为了保险起见,整个退出xcode.再起。。。还是base sdk missing...如此反复多次还是不行,有点邪门<br />google之,哦也,http://stackoverflow.com/questio

2011-01-27 13:49:00 8114 1

原创 Git

windows下先下载一个Git基础版,不需要下msysGit,如果你不打算 hack 它的话。当然这还不够,我们需要GUI,SVN上的小乌龟在Git上也有对应的TortoiseGit。mac下也是先下载git基础版。然后GUI就比较复杂了,有很多候选者GitX基本功能倒是有,但

2011-01-25 21:57:00 2475

原创 预处理宏定义

不同的编译器,库,条件编译时如何区分debug版本和release版本微软的编译器使用 _DEBUG 作为debug版本标准C库使用NDEBUG,作为release版本。比如如果定义了NDEBUG,则assert()函数将不会编译。

2011-01-25 11:18:00 6420

原创 cmake 中的 properties

RUNTIME_OUTPUT_DIRECTORY Output directory in which to build RUNTIME target files.cmake可构建三种 target files : archive, library, 和 runtime. Executables 总是 runtime targets. Static libraries 总是 archive targets. Module libraries总是 library targets. 对 non-DLL 平台,

2010-12-28 17:18:00 3789

原创 cmake 中的 variables

EXECUTABLE_OUTPUT_PATH 已过时,使用target 属性 RUNTIME_OUTPUT_DIRECTORY 。LIBRARY_OUTPUT_PATH 已过时,使用target 属性 ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, 和 RUNTIME_OUTPUT_DIRECTORY。CMAKE_BUILD_TYPE 构建类型,可能的值有:空, Debug, Release, RelWithDebInfo 和 MinSizeRel。C

2010-12-28 16:35:00 3361

原创 cmake 中的 commands

project 设置工程的名字。语法:project( [languageName1 languageName2 ... ] )。注意这条指令还隐式定义了另外两个变量_BINARY_DIR 和_SOURCE_DIR,并分别赋值。add_executable 添加工程生成的可执行文件,及它的源文件。语法:add_executable( [WIN32] [MACOSX_BUNDLE [EXCLUDE_FROM_ALL] source1 source2 ... sourceN)。add_subdirectory

2010-12-28 15:51:00 9953 1

原创 cmake 命令行

常用选项:-G 例如:cmake -G "MinGW Makefiles";注意generator是大小写敏感的,即使是在windows下。generator所用的命令(gcc,cl等)最好已经设置在环境变量PATH中。有个例外就是生成visual studio的工程不必设置环境变量,只要安装了对应的vs,cmake可以自动找到。

2010-12-28 10:40:00 29897 1

原创 将Qt Creator用作通用IDE

既然已经习惯了Qt Creator,索性将它作为通用IDE,另外还需要选择一个通用的make系统,当然这就是Qt Creator默认也支持的CMake。使用CMake作为构建系统,需要自己写CMakeLists.txt,相当于qmake下的pro,只不过更加与平台以及编译器无关。先来个最简单的CMakeLists.txt:PROJECT (HELLO)ADD_EXECUTABLE(kkk main.c) 嗯,相当简单,第一行定义工程名字,第二行定义可执行文件名字,以及依赖文件。下面可以使用Qt Crea

2010-12-23 15:35:00 13151 2

原创 捕获输入流中的错误

程序经常会提供从标准输入流中输入的操作,但是如果其中发生错误,则有可能导致后续的读取失败。程序中应该判断输入流的状态,并在错误发生时,清除缓冲区,重置状态。C的解决方式: while(1) { int i; if (scanf("%d",&i)) { printf("ok:%d/n",i); if (666 == i) break; }

2010-12-23 12:26:00 1880

原创 使用Qt内置引擎解析JSON格式数据

Qt有个模块Script可以用来解析ECMAScript QString json = "{/"name/":/"//u6c49//u5b57/"}"; QScriptEngine engine; QScriptValue value = engine.evaluate("var = " + json); QScriptValueIterator it(value); while (it.hasNext()) { it.next();

2010-12-22 21:59:00 9508

原创 编译boost

首先下载源代码包,解压之后,先得生成bjam——boost的构建工具。windows下如果已经安装了msvc,则只需运行一下bootstrap.bat,就会生成bjam.exe和project-config.jam这两个文件。如果用mingw的话,需要自己手动生成bjam.exe:去boost/tools/jam/src,执行build.bat gcc,即设置默认编译器为gcc。注意直接修改boost/bootstrap.bat 里的内容set toolset=gcc没有作用。如果成功,在bin.ntx86

2010-12-22 21:00:00 9081 1

原创 基本数据类型的长度

C/C++仅仅定义了这些基本数据类型之间的关系,并没有定义严格定义它们的字长。在不同的平台上,根据编译器不同的实现,它们的字长如下表所示:数据类型LP64ILP64LLP64ILP32LP32char88888short1616161616_int32N/A32N/AN/AN/Aint3264323216long6464323232long longN/AN/A64N/AN/Apointer6464643232在这张表中,LP64,ILP64,LLP64是64位平台上的字长模型,ILP32和LP32是32位

2010-12-20 15:24:00 886

原创 内存管理

内存泄露的检测<br />可使用sdk自带的工具instruments进行检测,他相当于一个IDE,除了内存泄露还可以检查很多程序问题,例如执行时间,运行性能等等。<br />刚开始不会用的时候犯了个错误:使用了常量字符串进行泄露检测:<br />//超乎想象,这里没有内存泄露NSString *leak1 = [[NSString alloc] initWithString:@"leak1"];leak1 = nil;//oh yeah!内存泄露NSMutableString *lea

2010-12-19 22:29:00 535

原创 cocos2d 中的奥妙

首先不得不提,cocos2d 的文档相当差,很多时候不得不直接看源代码 事件响应:只有CCLayer才具有响应键盘鼠标事件的能力,除此之外还需:self.isTouchEnabled = YES;...//override-(void) registerWithTouchDispatcher{ [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:NO];}

2010-12-19 22:11:00 3609

原创 坐标系统

Mac OS X 的坐标系统为原点在左下角,x轴向右,y轴向上,即笛卡尔坐标系不同于Mac OS X, iOS 的自然坐标系为原点在左上角,x轴向右,y轴向下,如UIView,UIImage...而当使用定制的Graphics Context时,例如往bitmap上画的时候,此时坐标系又变为笛卡尔坐标系。cocos2d使用OpenGL,因此也是笛卡尔坐标系。CCNode中的position为左下角CCNode中的anchorPoint为“锚点”,意思是将矩形中的某一点作为锚点,再将这个锚点钉到positio

2010-12-17 22:38:00 1695

原创 源文件编码方式

以下讨论两种常用编译器gcc,cl中对Unicode字面值的实现:GCCgcc中跟编码方式转换有关的三个编译选项:-finput-charset=charset,此选项指定源文件本身的编码方式,默认为UTF-8(有无BOM均可)。例如当我们的源代码文件保存为GBK时,则也应当将此选项的值指定为GBK。-fwide-exec-charset=charset,此选项指定宽字符或宽字符串的字面值常量的内部编码方式,默认为UTF-32或UTF-16,对应wchar_t的宽度。wchar_t的宽度依赖平台实现,win

2010-12-10 10:30:00 11038 5

原创 Category vs Protocol

Category:用来扩充类中的方法(包括可以添加自己的方法到Cocoa Framework中)作为子类,代替继承用来将类的实现分为几个部分(实现私有方法)用来声明非正式协议(声明的所有方法不必都实现)#import "ClassName.h" @interface ClassName ( CategoryName )// method declarations@end----------------------------------------#import "ClassName

2010-12-08 22:02:00 1114

cplusplus_reference

The standard C++ library is a collection of functions, constants, classes, objects and templates that extends the C++ language providing basic functionality to perform several tasks, like classes to interact with the operating system, data containers, manipulators to operate with them and algorithms commonly needed.

2010-10-08

超越c++标准库——boost程序库导论.chm

Boost带领你远远地超越了C++标准库,它使得C++编程更优雅、更有活力、更高产。首先,我们系统地介绍一下Boost库的主要组成和它们的主要用法。

2010-05-21

Effective STL by Scott Meyers

在《Effective STL》中,我解释了怎样结合STL组件来在库的设计得到最大的好处。这样的信息允许你对简单、直接的问题开发简单、直接的解决方案,也帮你对更复杂的问题设计优雅的方法。我描述了常见的STL使用错误,而且向你演示怎么避开它们。那帮助你躲开闪资源漏、不可移植的代码和未定义的行为。我讨论了优化代码的方法,所以你能使STL表现得像它应该的那样快速、光滑。

2010-05-21

python 教程 2

是一种容易学习的强大语言。它包括了高效的高级数据结构,提供了一个简单但很有效的方式进行面向对象编程。Python 优雅的语法,动态类型,以及它天然的解释能力,使其成为了大多数平台上应用于各领域理想的脚本语言以及开发环境

2010-05-21

gnu gdb 参考手册

Overview Many
Linux
and
Unix
developers
are
familiar
with
the
GNU
debugger
(GBD),
the
invaluable
open
source
tool
for
testing,
fixing,
and
retesting
 software.
And
since
GDB
can
be
ported
to
Windows,
Microsoft
developers
and
others
who
use
this
platform
can
also
take
advantage
of
this
 amazing
free
software
that
allows
you
to
see
exactly
what's
going
on
inside
of
a
program
as
it's
executing.
This
new
pocket
guide
gives
you
a


2010-05-21

gnu gcc 参考手册

GCC stands for “GNU Compiler Collection”. GCC is an integrated distribution of compil- ers for several major programming languages. These languages currently include C, C++, Objective-C, Objective-C++, Java, Fortran, and Ada.

2010-05-21

boost bjam 参考手册

This section will provide the information necessary to create your own projects using Boost.Build. The information provided here is relatively high-level, and Reference as well as the on-line help system must be used to obtain low-level documentation (see --help).

2010-05-21

python 初级教程

A Byte of Python' is a book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you

2010-05-21

在Linux世界驰骋系列之Shell编程

Linux环境中,Shell不仅是常用的命令解释程序,而且是高级编程语言。本讲介绍Shell概述、Shell变 量、位置参数、特殊符号、别名、各种控制语句、函数等Shell编程知识。

2010-05-21

MySQL中文参考手册

MySQL是一个精巧的SQL数据库管理系统,虽然它不是开放源代码的产品,但在某些情况下你可以自由使用。由于它的强大功能、灵活性、丰富的应用编程接口(API)以及精巧的系统结构,受到了广大自由软件爱好者甚至是商业软件用户的青睐,特别是与Apache和PHP/PERL结合,为建立基于数据库的动态网站提供了强大动力。

2010-05-21

Objective-C Pocket Reference

Objective-C Pocket Reference provides a quick and concise introduction to Objective-C for programmers already familiar with either C or C++, and will continue to serve as a handy reference even after the language is mastered. In addition to covering the essentials of Objective-C syntax, it also covers important facets of the language such as memory management, the Objective-C runtime, dynamic loading, distributed objects, and exception handling.

2010-05-21

空空如也

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

TA关注的人

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