07 2016 档案
摘要:// // RootViewController.m #import "RootViewController.h" #import <AudioToolbox/AudioToolbox.h> @interface RootViewController () @end @implementation
阅读全文
摘要:// RootViewController.m #import "RootViewController.h" #import <MediaPlayer/MediaPlayer.h> #define PATH @"http://clips.vorwaerts-gmbh.de/big_buck_bunn
阅读全文
摘要:#import "RootViewController.h" @interface RootViewController () { UITableView * table; NSMutableArray * dataSource; } @end @implementation RootViewCon
阅读全文
摘要:// // RootViewController.m #import "RootViewController.h" #define SCROLLWIDTH 300 //宽 #define SCROLLHEIGHT 350 //高 @interface RootViewController () {
阅读全文
摘要:// // RootViewController.m #import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController //创建背景视图 -(void)cre
阅读全文
摘要://结论: //子类能继承父类中的所有方法 包括类别中的方法
阅读全文
摘要://创建计步器 -(void)createStepper { //<1>创建对象 UIStepper * stepper = [[UIStepper alloc]initWithFrame:CGRectMake(100, 100, 100, 30)]; //<2>为stepper添加背景颜色 //s
阅读全文
摘要:#import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; ...
阅读全文
摘要:局部刷新//一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimatio
阅读全文
摘要:for (UIViewController *controller in self.navigationController.viewControllers) { if ([controller isKindOfClass:[PlaceOrderVC class]]) { [self.navigat
阅读全文
摘要:1、创建 @interface AppDelegate (){ CustomTabBarViewController *tabbar;} tabbar=[CustomTabBarViewController defaultsTabBar]; self.window.rootViewControlle
阅读全文
摘要:支持MJRefresh刷新可在header里面添加 滚动视图 footer里面添加按钮
阅读全文
摘要:- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //1. 判断系统版本 if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0) { //可以使用指纹识别 --> 5S 以后的机型 LAConte...
阅读全文
摘要:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; /...
阅读全文
摘要:NSString * deliverydate = dicUrl[@"deliverydate"]; NSString * arrivedate = dicUrl[@"arrivedate"]; if (![self compareDate:deliverydate withDate:arrived
阅读全文
摘要:@property (nonatomic,strong) UIView * submitView; //创建自定义提示框 - (void)viewDidLoad { [super viewDidLoad]; _submitView = [[UIView alloc]initWithFrame:CGR
阅读全文
摘要:-(UITextField*)createField:(NSString*)placeholder andTag:(int)tag andFont:(double)font{ UITextField * field =[[UITextField alloc]init]; field.frame = CGRectMake(0, 0, Main_Width-91, 50...
阅读全文
摘要://视图控制器声明周期的四个方法 -(void)viewWillAppear:(BOOL)animated { //视图将要显示的时候调用该方法 NSLog(@"viewWillAppear: --- root"); //一般的时候我们会在该方法中对当前视图控制器上的视图内容进行重构(控件的显示位置 已经控件上显示的内容) self.view.background...
阅读全文
摘要:// AppDelegate.h #import @interface AppDelegate : UIResponder //UIResponder是XCode5.0以后出现的新类 //新的iOS 将iOS的响应事件分为3种 //将三种响应事件封装成一个新的类 UIResponder /* touch 触摸事件 remote 远程操控事件 motion 摇晃事件 */ //...
阅读全文
摘要:- (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"第一页"; self.view.backgroundColor = [UIColor cyanColor]; [self createBtn]; second = [[SecondViewControl...
阅读全文
摘要:- (void)viewDidLoad { [super viewDidLoad]; [self createUI]; xiaoCustom = [[Custom alloc]init]; [xiaoCustom setValue:@"test" forKey:@"name"]; [xiaoCustom setValue:[NSNumber nu...
阅读全文
摘要:// // RootViewController.m #import "RootViewController.h" @interface RootViewController () { NSMutableArray * dataSource; } @end @implementation RootViewController -(void)createUI { NSAr...
阅读全文
摘要:- (BOOL) checkCardNo:(NSString*) cardNo{ int oddsum = 0; //奇数求和 int evensum = 0; //偶数求和 int allsum = 0; int cardNoLength = (int)[cardNo length]; int lastNum = [[cardNo subs...
阅读全文
摘要:#import "ViewController.h" #import "CardIO.h" @interface ViewController ()<CardIOPaymentViewControllerDelegate> @end @implementation ViewController -
阅读全文
摘要:#import "ViewController.h" #import "KLFaceDetector.h" #define FACEIMGVIEW_TAG 100001 @interface ViewController () @property (nonatomic, strong) UIImag
阅读全文
摘要:// ViewController.m #import "ViewController.h" @interface ViewController () { //任务队列,能够自动管理多个任务(NSOperation的对象) NSOperationQueue *_operationQueue; } @end @implementation ViewController #d...
阅读全文
摘要:#import "RootViewController.h" #import "FMDatabase.h" @interface RootViewController () { FMDatabase * myDB; } @end @implementation RootViewController //FMDB是将SQLite中复杂的SQL语法进行封装 //FMDB适用于ARC或者MR...
阅读全文
摘要://广告标示符,适用于对外:例如广告推广,换量等跨应用的用户追踪等。 NSString *adId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; NSLog(@"adId==%@",adId); //Vindor标示符,适用于对内:例如分析用户在应用内的行为等...
阅读全文
摘要:// BOY.h #import @interface BOY : NSObject @property (nonatomic,retain) NSString * boyName; @end // GIRL.h #import @interface GIRL : NSObject @property (nonatomic,retain) NSString * girlNa...
阅读全文
摘要:用 presentViewController和dismissViewControllerAnimated 实现 pushViewController和popViewControllerAnimated动画
阅读全文
摘要:VC cell里面点击按钮 效果图:
阅读全文
摘要:// // RegularHelp.m // #import "RegularHelp.h" @implementation RegularHelp //没使用 + (BOOL) validateUserAge:(NSString *)str { NSRegularExpression *regul
阅读全文
摘要:定义方法: 调用的时候: 在一个类中: Model *model =[Model initWithName:@"testName1" AndAge:@"1"]; 在另一个类中:Model *model =[Model initWithName:@"testName2" AndAge:@"2"]; 结
阅读全文
摘要:代理传值: // SendViewController.h #import <UIKit/UIKit.h> @protocol SendInFor <NSObject> -(void)sendInForIdea:(NSString*)text; @end @protocol SendInForTwo
阅读全文
摘要:同一台笔记本下的客户端和服务端 TCPClient 客户端: // RootViewController.h#import <UIKit/UIKit.h>#import "AsyncSocket.h" //封装了基于tcp协议的socket编程//tcp协议是位于网络传输层的协议,规定客户端与服务端
阅读全文
摘要:xib的 //不使用这种- (IBAction)button:(UIButton *)sender; //使用这种 @property (weak, nonatomic) IBOutlet UIButton *button; 在cell里面直接调用 [cell.button addTarget:se
阅读全文
摘要:// RootViewController.m #import "RootViewController.h"#import "NextViewController.h"@interface RootViewController (){ NSMutableArray * dataSource;//数据
阅读全文
摘要:利用NSMutableDictionary key值 来改变cell的状态 -(void)createUI{ table = [[UITableView alloc]initWithFrame:CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.
阅读全文
摘要:1、实现UITableView类似抽屉开关控制器的功能 2、使用NSUserDefaults实现cell中输入UIfield的保存功能 // RootViewController.h#import <UIKit/UIKit.h> @interface RootViewController : UIV
阅读全文
摘要:NSDate * senddate=[NSDate date]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; NSDateComponen
阅读全文
摘要:// placeholder 颜色 [field setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"]; // placeholder 字体大小 [field setValue:[UIFont boldSyste
阅读全文
摘要:判断是否为null//尖括号 if ([regeocode.city isEqual:[NSNull class]]) { NSLog(@"123"); } //圆括号 if (regeocode.city == nil) { NSLog(@"345"); }
阅读全文
摘要:1、添加按钮的点击事件和按下事件 [btn setImage:[UIImage imageNamed:@"NorMal.png"] forState:UIControlStateNormal]; //正常背景图片 [btn setImage:[UIImage imageNamed:@"Highlig
阅读全文
摘要:[btn setImage:[UIImage imageNamed:@"test.png"] forState:UIControlStateNormal];btn.adjustsImageWhenHighlighted = NO;
阅读全文
摘要:for (id obj in self.view.subviews) { if ([obj isKindOfClass:[UIButton class]]) { UIButton * theButton = (UIButton *)obj; } }
阅读全文
摘要:#define WhiteColor [UIColor whiteColor]#define YellowColor Color_RGB(253,131,42,1)//主题黄#define Font(a) [UIFont systemFontOfSize:a * kWidth]; UIButton
阅读全文
摘要:UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.backgroundColor = [UIColor cyanColor]; btn.frame = CGRectMake(100, 100, 100, 100);
阅读全文
浙公网安备 33010602011771号