Java中的回调函数学习博客分类:J2SEJavaJ#一般来说分为以下几步:声明回调函数的统一接口interface A,包含方法callback();在调用类caller内将该接口设置为私有成员private A XXX;在caller内提供实现A接口的public方法(将外部该接口的实现类通过形...
分类:
编程语言 时间:
2015-02-12 17:41:10
阅读次数:
154
还是直接贴代码了。第一步:@interface TodoViewController (){ //声明一个数组 存放cell的信息 NSMutableArray *grouparr;}@end第二步://将cell的状态存入数组中-(void)initDataSource{ N...
分类:
其他好文 时间:
2015-02-12 15:44:15
阅读次数:
153
定义:Defined an interface for creating an object,but let subclasses decide which class to instantiate.Factory Method let a class defer instantiation to ...
分类:
其他好文 时间:
2015-02-12 15:44:15
阅读次数:
237
#import typedef void(^MyCompleteHandler) (NSString *selectString);@interface TJCustomAlertViewOrTableView : UIView{ MyCompleteHandler completeHand...
分类:
其他好文 时间:
2015-02-12 15:29:15
阅读次数:
142
本文主要介绍了如何将mybatis和spring整合在一起使用,本人使用的是mybatis3.05 + spring3.1.0M2 ,使用dbcp作为数据库连接池。1.编写数据访问接口(UserDao.java)package com.mybatis;public interface UserDao...
分类:
编程语言 时间:
2015-02-12 10:31:02
阅读次数:
185
1、监控输出日志接口
/**
*
* 监控输出日志接口
*/
public interface LogcatObserver {
/**
*
* @param info
* 输出的日志信息
*/
public void handleLog(String info);
}
2、继承一个服务
public class LogcatScan...
分类:
移动开发 时间:
2015-02-12 09:19:16
阅读次数:
251
第一步:在程序中新建一个包,包名必须为:com.android.internal.telephony,因为要使用aidl。
第二步:在这个包里面新建一个名为ITelephony.aidl的文件,然后在文件里面写入代码:
package com.android.internal.telephony;
interface ITelephony{
boo...
分类:
其他好文 时间:
2015-02-11 22:02:33
阅读次数:
158
Context 英文直译:上下文Google官方文档概述:Interface to global information about an application environment. This is an abstract class whose implementation is provi...
分类:
移动开发 时间:
2015-02-11 20:23:42
阅读次数:
148
由java转入IOS开发了,自学配合实际项目记录一些项目中用到的技巧,APP比较小,涉及到的知识点比较简单,大牛就不用看了,小兵大家一起讨论。
单例模式就是确保在程序运行过程中,一个类只有一个实例,公司的APP的账号管理是通过单例实现的。先上代码:
@interface JVAccountManager : NSObject
+ (JVAccountManager *)sharedAccount;...
分类:
移动开发 时间:
2015-02-11 18:37:36
阅读次数:
258
Working with Constraints in Interface Builder
The easiest way to add, edit, or remove constraints is to use the visual layout tools in Interface Builder. Creating a constraint is as simple as Contr...
分类:
移动开发 时间:
2015-02-11 16:48:10
阅读次数:
631