用C代替OC:
#import
#import
#import
extern int UIApplicationMain (int argc,char *argv[],void *principalClassName,void *delegateClassName);
struct Rect {
...
分类:
移动开发 时间:
2016-05-12 11:52:56
阅读次数:
239
一些公用类:
@interface CustomClass : NSObject
- (void) fun1;
@end
@implementation CustomClass
- (void) fun1
{
NSLog(@"fun1");
}
@end
@interface TestClass :...
分类:
移动开发 时间:
2016-05-12 11:52:45
阅读次数:
262
在使用Handler更新UI的时候,我是这样写的:
public class SampleActivity extends Activity {
private final Handler mLeakyHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
//...
分类:
其他好文 时间:
2016-05-12 11:50:39
阅读次数:
177
这一章节我们来讨论一些同步静态方法和静态代码块。代码清单package com.ray.deepintothread.ch02.topic_17;
/**
*
* @author RayLee
*
*/
public class SynchClass {
public static void main(String[] args) throws InterruptedExceptio...
分类:
编程语言 时间:
2016-05-12 11:40:53
阅读次数:
239
这一章节我们来讨论一下同步方法与同步静态代码块持有的是不同的锁。代码清单:package com.ray.deepintothread.ch02.topic_18;
/**
*
* @author RayLee
*
*/
public class SynchClass {
public static void main(String[] args) throws Interrupte...
分类:
编程语言 时间:
2016-05-12 11:30:40
阅读次数:
192
1.广播接收者
广播接收者简单地说就是接收广播意图的Java类,此Java类继承BroadcastReceiver类,重写:
public void onReceive(Context context,Intent intent),其中intent可以获得传递的数据;
广播意图就是通过Context.sendBroadcast(Intent intent)或Context.sendOr...
分类:
其他好文 时间:
2016-05-12 11:22:00
阅读次数:
181
- (void)startCountDownAction{ //开始倒计时 codebtn 是发送验证码的btn ,也是倒计时的UI self.codeBttn.enabled = NO; __block int timeout = 60; [self.codeBttn setTitle:@"60秒 ...
分类:
其他好文 时间:
2016-05-12 10:28:39
阅读次数:
180
import java.util.Random; public class Homework0511 { public static void main(String[] args) { 运行结果: ...
分类:
其他好文 时间:
2016-05-12 09:08:48
阅读次数:
151
red5源码分析—服务器处理publish命令
和前几章的分析一样,服务器接收到客户端发来的publish命令后,最终会执行RTMPHandler的onCommand函数,再参考《red5源码分析—8》的分析,最终会调用StreamService的publish方法,代码如下
public void publish(String name, String mode) {...
分类:
其他好文 时间:
2016-05-12 01:44:48
阅读次数:
225
HashSet,锋芒毕露,我们最常用到。其他两个,我们较少用到,今天,我们看看他们的区别。 import java.util.HashSet; import java.util.Set; public class HashSetTester { public static void main(Str ...
分类:
编程语言 时间:
2016-05-12 01:28:59
阅读次数:
198