【iOS开发-119】ipa打包、单元测试test、本地通知UILocalNotification

来源:互联网 发布:美丽折淘客软件下载 编辑:程序博客网 时间:2024/06/13 03:43

(1)ipa打包,可以用Xcode,也可以用iTunes,用后者比较快。

具体教程:使用XCode和iTunes打包ipa i OS_ipa打包的方法


(2)单元测试(一般用于测试某一个方法是否可行等等)

——轻量化

——和程序target是单独分开的

——比较直观快读地知道测试结果

相对而言,还有集群测试(一般测试一些模块和功能)、压力测试(加大数据或者用户进行测试)


(3)本地通知

#import "ViewController.h"@interface ViewController ()- (IBAction)addLocalNotification:(id)sender;@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];    if ([[UIDevice currentDevice].systemVersion doubleValue]>=8.0) {        UIUserNotificationSettings *setting=[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];        [[UIApplication sharedApplication]registerUserNotificationSettings:setting];    }}- (void)didReceiveMemoryWarning {    [super didReceiveMemoryWarning];    // Dispose of any resources that can be recreated.}- (IBAction)addLocalNotification:(id)sender {    //创建    UILocalNotification *localNoti=[[UILocalNotification alloc]init];    //设置    localNoti.alertAction=@"开始玩游戏";//操作提示    localNoti.alertBody=@"这是alertBody";//提示内容    localNoti.repeatInterval=NSCalendarUnitDay;//提示间隔    localNoti.applicationIconBadgeNumber=3;//badge number    localNoti.fireDate=[NSDate dateWithTimeIntervalSinceNow:3];//什么时候开始提示    //注册,先删除之前所有的,再添加,防止重复    [[UIApplication sharedApplication] cancelAllLocalNotifications];    [[UIApplication sharedApplication] scheduleLocalNotification:localNoti];}@end

如果需要点击本地通知,到特定的页面,则需要判断。

——程序在运行时,点击本地通知的话,会调用AppDelegate.m的如下方法。直接点击icon图标的话,就正常启动。

-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{    }


0 0
原创粉丝点击