08 2015 档案
摘要:布局行列关系 列与X轴 行与Y轴列% 行/1.//获取当前屏幕的宽度CGFloat swidth = [UIScreen mainScreen].bounds.size.width;//边界到控件的距离int space = (swidth - 260)/2;for (int i = ...
阅读全文
摘要:#import "ViewController.h"#import "Person.h"@interface ViewController (){ UIImageView *_imgView; NSMutableArray *_personsArray; //存放所有注册用户的信息}@end@i...
阅读全文
摘要:#import "AppDelegate.h"@interface AppDelegate ()@end@implementation AppDelegate{ //全局变量 UILabel*lablel;}-(void)dealloc{ self.window=nil; [...
阅读全文
摘要:main#import #import "AppDelegate.h"//UIApplication对象:这是应用程序的象征,是iOS程序第一个创建的对象。每一个程序都有自己的UIApplication对象//UIApplication对象的创建:[UIApplication sharedAppli...
阅读全文
摘要:#import "AppDelegate.h"@interface AppDelegate ()@property(nonatomic,strong)NSArray*app;@end@implementation AppDelegate-(NSArray *)app{ if (_app == ni...
阅读全文
摘要:#import #import "AppDelegate.h"/*UIApplication:这个应用程序的象征,是程序第一个创建的对象,每个程序都有自己的 UIApplication对象 UIApplication对象的创建:[UIApplication sharedApplication];利用...
阅读全文
摘要:#import #define PATH1 @"/Users/aoyolo5/Desktop/文件管理"#define PATH2 @"/Users/aoyolo5/Desktop/文件管理/name.txt"#define PATH3 @"/Users/aoyolo5/Desktop/array....
阅读全文
摘要:Student.h#import @interface Student : NSObject@property (nonatomic, copy) NSString *name;@property (nonatomic, assign) int ID;@endStudent.m#import "St...
阅读全文
摘要:BoosProtocol.h#import //创建协议@protocol BoosProtocol @required//必须实现的方法-(NSInteger)buyWood;@optional//可选实现-(void)text3;@endWorkeProtocol.h#import @proto...
阅读全文
摘要:Person.h#import @interface Person : NSObject-(void)eat;@end//2.第二种方法//分类的声明//创建分类@interface ()@interface Person (MyCategory)-(void)run;@endPerson.m#i...
阅读全文
摘要:NSArray+LogNSArray+Log.h#import @interface NSArray (Log)@endNSArray+Log.m#import "NSArray+Log.h"@implementation NSArray (Log)- (NSString *)description...
阅读全文
摘要:Person.h#import @interface Person : NSObject@property(nonatomic,copy)NSString*name;@property(nonatomic,assign)long int ID;-(void)addObserver;//添加观察者-(...
阅读全文
摘要:Student.h#import @interface Student : NSObject@property (nonatomic, copy) NSString *name;- (instancetype)initWithName:(NSString *)name;//单例:default st...
阅读全文
摘要:#import int main(int argc, const char * argv[]) { @autoreleasepool { /* 本地存储(数据持久化): 1.NSUserdefaults 2.NSCoding 3.Sqlite 4.文件存储 ...
阅读全文
摘要:Person.h#import @interface Person : NSObject@property (nonatomic, copy) NSString *userName;@property (nonatomic, copy) NSString *password;@property (n...
阅读全文
摘要:#import void test(void (^block1)()){ block1();}void test2(int (^blk2)(int, int)){ int sum = blk2(10, 20); NSLog(@"%d",sum);}int main(int argc, const...
阅读全文
摘要:协议概念Protocol(协议)(一)简介1.Protocol:就一个用途,用来声明一大堆的方法(不能声明成员变量),不能写实现。2.只要某个类遵守了这个协议,就拥有了这个协议中的所有方法声明。3.只要父类遵守了某个协议,那么子类也遵守。4.Protocol声明的方法可以让任何类去实现,protoc...
阅读全文
摘要:知识点 1.自动释放池 2.继承与多态========================自动释放池 1.什么是自动释放池 2.自动释放池的作用 1)思考:如何释放在函数中需要返回的对象 3.如何创建一个自动释放池 @autoreleasepool{} --- IOS5.0以后 4.自动释放池...
阅读全文
摘要:知识点 1.内存管理作用 2.内存管理原理 3.黄金法则 4.setter/getter 5.属性======================================内存管理 1.回忆:c语言中通过那些函数实现的内存管理 c malloc free 空指针 if (xxx != nu...
阅读全文
摘要:字符串1.比较两个字符创是否相等if([Str1 isEquarToString:str2])2.比较两个字符串是否为同一个对象if([Str1 isEquarToString:str2]) if(Str1==str2)3.比较字符串的大小NSComparisonResult result=[str...
阅读全文
摘要:知识点 1.NSDictionary 2.NSMutableDictionary===========================NSDictionary 1.思考:现在需要通过名字查找到指定的电话号码 1)通过NSArray是否可以实现 2)是否容易实现 2.NSDictionary ...
阅读全文
摘要:#import #import "Person.h"int main(int argc, const char * argv[]) { @autoreleasepool {#pragma make创建数组 //数组中得元素,必须是对象 //通过实例方法创建 NSArray*array=[[NSArr...
阅读全文
摘要:#import int main(int argc, const char * argv[]) { @autoreleasepool { /*在这里主要说一下数据类型:NSString字符串、NSDate日期、NSArry数 NSDictionary字典。*/ #pragma ma...
阅读全文
摘要:知识点 1.NSArray 2.NSMutableArray 3.字符串的 NSArray NSDictionary NSSet 数据集合 (collections)============================NSArray---NSMutableArray 1.NSArray...
阅读全文
摘要:知识点 1.NSString 类的使用 2.NSMutableString 类的使用=================================NSString 0.NSString对象 1.为什么需要NSString对象 2.oc中字符串和c语言字符串的对比 1)输出方式 2)引...
阅读全文
摘要:知识点 1.Objective-c Hello World 2.NSLog使用 3.面向对象编程思想--类和对象 4.类的定义和使用 5.面向对象编程思想--封装 6.声明和实现相分离 7.类的实例化--对象 IDE========================================...
阅读全文
摘要:1.查找某数下标#include int main(int argc, const char * argv[]) { int a[10]={3,2,0,4,5,8,9,7,6,1}; int a1; int i=0; printf("请输入数值:"); scanf("%...
阅读全文
摘要:排序法1.选择排序法思路:在自定义函数中定义两个局部变量i,j;iarray[j]) 从大到大排序 if (array[j]>array[i])#include int main(int argc, const char * argv[]) { int array[]={1,2...
阅读全文

浙公网安备 33010602011771号