`
cenphoenix
  • 浏览: 160514 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论
文章列表
Have you been wondering how to create a class and use it as an object in Objective-C? Anyone who is used to object-oriented programming will recognize the pattern demonstrated here. You will learn how to: use properties, allocate and de-allocate objects in memory, use a methods and you will see how ...
Here is one easy way to save data in your iPhone apps. If you are using an array, say a list of strings, you can easily save that information to the documents directory of your app. In this example, we are going to create an array, fill it with values and then save the contents of the array to the d ...
Arrays are structures used to hold a list of objects. Sometimes though you may want to sort the order that the elements appear. Doing this is actually pretty simple once you know how, essentially you will be using the NSArray sortedArrayUsingSelector method. For example, if you create an array like ...
在Objective-C中,有一些我们之前并不熟悉但是经常见到的数据类型,比如id、nil、Nil、SEL等等。在很多文章里,我们都见过这些数据类型的介绍,但是都没有说的太清楚。 这篇文章从最底层的定义开始,介绍一下这些类型到底是怎么定义的,这会帮助我们更加深入地了解Objective-C。 原文作者为Greg Miller,文章地址在: http://unixjunkie.blogspot.com/2006/02/nil-and-nil.html Objective-C中有一些很有趣的数据类型经常会被错误地理解。他们中的大多数都可以在/usr/include/objc ...
大部分有一点其他平台开发基础的初学者看到XCode,第一感想是磨拳擦掌,看到Interface Builder之后,第一感想是跃跃欲试,而看到Objective-C的语法,第一感想就变成就望而却步了。好吧,我是在说我自己。 如果你和我一样,对 ...
苹果开发技术: Cocoa 框架概述 Cocoa Framework简称Cocoa,它是Mac OS X上的快速应用程序开发(RAD, Rapid Application Development)框架,一个高度面向对象的(Object Oriented)开发框架。无论您是资深的Mac开发人员,还是即将踏入Mac开发世界的新新人类,Cocoa都是您开发应用程序的瑞士军刀、乐高积木,它是您构建Mac OS X应用程序最强大、最高效的工具。值得一提的是,苹果公司之所以能够开发出众多顶级软件,其实也正是因为有着Cocoa这个秘密武器。Cocoa是Mac OS X上原生支持的应用程序开发框架,苹果公司强烈 ...
主要思路     Tween 动画通过对 View 的内容完成一系列的图形变换 (包括平移、缩放、旋转、改变透明度)来实现动画效果。 具体来讲,预先定义一组指令,这些指令指定了图形变换的类型、触发时间、持续时间。这些指令可 ...
学了一段时间 objective-c properties 概念一直比较疑惑。 @property ( <parameters>) <type> <name>; 类似 java 中 get set 方法, parameters: copy retain assign nonatomic readonly 逐个剖析一下 assign: 对基础数据类型 (NSInteger,CGFloat)和C数据类型(int, float, double, char, 等等) 应该没有引用指针的概念 相当于 =。 copy:  对NSString  相当于是clon ...
http://www.iphonetoolchain.cn/viewthread.php?tid=10&extra=page%3D1
android创建资源文件其实很简单,但如果是创建自定义的原生资源的话,可能不知所措,特别是在刚接触android开发时,废说少说,切入正题 1、在res新建目录raw,如图所示:   2、在raw下新建议自己文件或拷贝文件到此目录下,此时R.java会自己生成如R.raw.i18n    注意:此目录下的文件名必需小写,不然会报错。   3、读取自定义资源,如: InputStream in = context.getResources().openRawResource(R.raw.i18n);  
Canvas 作为绘制文本时,使用FontMetrics对象,计算位置的坐标。 它的思路和java.awt.FontMetrics的基本相同。 FontMetrics对象 它以四个基本坐标为基准,分别为: ・FontMetrics.top ・FontMetrics.ascent ・FontMetrics.descent ・FontMetrics.bottom Paint textPaint = new Paint( Paint.ANTI_ALIAS_FLAG); textPaint.setTextSize( 35); textPaint.setColor( Color.WH ...
一般在刚开始开发android时,会犯一个错误,即在View的构造函数中获取getWidth()和getHeight(),当一个view对象创建时,android并不知道其大小,所以getWidth()和getHeight()返回的结果是0,真正大小是在计算布局时才会计算,所以会发现一个有趣的事,即在onDraw( ) 却能取得长宽的原因。 width = activity.getWindowManager().getDefaultDisplay().getWidth(); height = activity.getWindowManager().getDefaultDisplay(). ...
MyActivity.java  requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title); TextView titleTV = (TextView)findViewById(R.id.title); titleTV.setText(R.string.app_name); title.xml & ...
有很多朋友使用Thread进行Progress的进度控制,这里我们使用Timer和TimerTask控制ProgressBar。 实现效果: 在进度75%之前,每秒钟有5%的进度,在75%之后每秒有1%的进度。 需要的知识: 1、ProgressBar 2、Thread 3、Timer和TimerTask  Activity代码: package cc.androidos.pb;import java.util.Timer; import java.util.TimerTask;import android.app.Activity; import android.os.B ...
...
Global site tag (gtag.js) - Google Analytics