资源简介
蓝牙与外设自动连接 交互 智能报警提示 智能定位等功能
代码片段和文件信息
//
// AlarmViewController.m
// BluetoothTest
//
// Created by Pro on 14-4-8.
// Copyright (c) 2014年 Pro. All rights reserved.
//
#import “AlarmViewController.h“
#import “config.h“
#import
//#import
@interface AlarmViewController ()
@end
@implementation AlarmViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
_table = [[UITableView alloc]initWithframe:CGRectMake(0 0 kDeviceWidth kDeviceHeight) style:UITableViewstyleGrouped];
_table.dataSource =self;
_table.delegate = self;
[self.view addSubview:_table];
UIButton *bu = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[bu settitle:@“返回“ forState:UIControlStateNormal];
bu.layer.cornerRadius = 5;
bu.layer.masksToBounds = YES;
[bu setBackgroundImage:[UIImage imageNamed:@“back2.png“] forState:UIControlStateNormal];
[bu addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
bu.frame = CGRectMake(0 0 60 30);
UIBarButtonItem *backBarButton = [[UIBarButtonItem alloc]initWithCustomView:bu];
self.navigationItem.leftBarButtonItem = backBarButton;
_arr = [NSMutableArray arrayWithobjects:@“电子警报音效“@“防盗器音效“@“雷达咚咚音效“@“信号灯音效“ nil];
}
-(void)backClick:(id)sender
{
[self.navigationController popToRootViewControllerAnimated:YES];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [_arr count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identified = @“cell“;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identified];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithstyle:UITableViewCellstyleDefault reuseIdentifier:identified];
UIButton *play = [UIButton buttonWithType:UIButtonTypeRoundedRect];
play.frame = CGRectMake(230 10 60 30);
[play addTarget:self action:@selector(playAction:event:) forControlEvents:UIControlEventTouchUpInside];
[play settitle:@“播放“ forState:UIControlStateNormal];
[cell.contentView addSubview:play];
cell.backgroundColor = [UIColor clearColor];
}
cell.textLabel.text = [_arr objectAtIndex:indexPath.row];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *name = [tableView cellForRowAtIndexPath:indexPath].textLabel.text;
NSLog(@“%@“name);
[_delegate selectAlarm:name to:_index];
[self.navigationController popView
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-05-07 21:28 BluetoothTest娴嬭瘯\
文件 15364 2014-05-03 10:01 BluetoothTest娴嬭瘯\.DS_Store
目录 0 2014-05-28 14:31 __MACOSX\
目录 0 2014-05-28 14:31 __MACOSX\BluetoothTest娴嬭瘯\
文件 82 2014-05-03 10:01 __MACOSX\BluetoothTest娴嬭瘯\._.DS_Store
目录 0 2014-05-13 14:44 BluetoothTest娴嬭瘯\.git\
目录 0 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\branches\
文件 15 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\COMMIT_EDITMSG
文件 137 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\config
文件 73 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\desc
文件 23 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\HEAD
目录 0 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\
文件 452 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\applypatch-msg.sample
文件 896 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\commit-msg.sample
文件 189 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\post-update.sample
文件 398 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\pre-applypatch.sample
文件 1642 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\pre-commit.sample
文件 1352 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\pre-push.sample
文件 4951 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\pre-reba
文件 1239 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\prepare-commit-msg.sample
文件 3611 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\hooks\update.sample
文件 8056 2014-05-13 14:44 BluetoothTest娴嬭瘯\.git\index
目录 0 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\info\
文件 40 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\info\exclude
目录 0 2014-05-28 14:31 __MACOSX\BluetoothTest娴嬭瘯\.git\
目录 0 2014-05-28 14:31 __MACOSX\BluetoothTest娴嬭瘯\.git\info\
文件 171 2014-04-06 10:08 __MACOSX\BluetoothTest娴嬭瘯\.git\info\._exclude
目录 0 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\logs\
文件 167 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\logs\HEAD
目录 0 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\logs\refs\
目录 0 2014-04-06 10:08 BluetoothTest娴嬭瘯\.git\logs\refs\heads\
............此处省略303个文件信息
- 上一篇:epics概述,epics基本原理技术讲解
- 下一篇:高通QFIL刷机工具
评论
共有 条评论