跨类的通讯,可以使用Notification,也可以使用Event。这里记录一下实现Event的方法:
首先,定义的类要从UIControl继承。SocketUtils类 子controlSocketUtils头文件
#import
#import "AsyncSocket.h"@interface SocketUtils : UIControl{}enum {...
分类:
其他好文 时间:
2015-06-03 17:39:34
阅读次数:
118
Android-Service通知与线程
一 用户如何与运行的Service交互
1 Toast Notification
2 系统通知栏 StatusBar Notification
二 与线程的选择
1 选择多线程:
当你需要在你当前操作的时候另外起一个独立操作的时候可以考虑线程,比如程序不关闭来运行音乐
从逻辑上你认为需要一个后台操作,但是跟我们主线程操作通讯频...
分类:
移动开发 时间:
2015-06-03 13:44:41
阅读次数:
208
Notification Centers
通知中心
A notification center manages the sending and receiving of notifications. It notifies all observers of notifications meeting specific criteria. The notification infor...
分类:
其他好文 时间:
2015-06-02 23:31:53
阅读次数:
502
PendingIntent有一个getActivity方法,第一个参数是上下文,第二个参数 requestCode,第三个参数是 Intent,用来存储信息,第四个参数是对参数的操作标识,常用的就是FLAG_CANCEL_CURRENT和FLAG_UPDATE_CURRENT。当使用FLAG_UPD...
分类:
移动开发 时间:
2015-05-30 16:26:01
阅读次数:
2516
logcat里有信息,而无法显示Notification,之前在代码里设置了 PushAgent.setPushIntentServiceClass(MyPushIntentService.class) ?搞了我一天,才发现是这个问题 ? logcat里有信息,而无法显示Notificat...
分类:
其他好文 时间:
2015-05-29 12:21:45
阅读次数:
114
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, ...
分类:
编程语言 时间:
2015-05-29 12:20:05
阅读次数:
133
Native app有很大一部分的时间是在等待事件发生,然后响应事件,比如等待网络请求完成,等待用户的操作,等待某些状态值的改变等等,等这些事件发生后,再做进一步处理。 但是这些等待和响应,并没有一个统一的处理方式。Delegate, Notification, Block, KVO, 常常会不知道...
分类:
其他好文 时间:
2015-05-29 11:45:25
阅读次数:
128
在前台运行的 Activity 可以通过Dialog、Toast 向用户发出提示信息,而后台运行的程序,如下载、收到信息等 Service应用,则需要使用 Notification(通知)向用户发出提示信息。 1 import android.app.Activity; 2 import andro...
分类:
移动开发 时间:
2015-05-28 21:14:38
阅读次数:
244
iOS开发中消息传递机制(KVO/NOtification/Block/代理/Target-Action)今晚看到了一篇好的文章,所以就搬过来了,方便自己以后学习虽然这一期的主题是关于Foundation Framework的,不过本文中还介绍了一些超出Foundation Framework(KV...
分类:
移动开发 时间:
2015-05-27 20:58:42
阅读次数:
317
Alarm的简单使用MainActivity.java代码如下: import java.util.Calendar;import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import...
分类:
其他好文 时间:
2015-05-27 10:24:09
阅读次数:
157