- 博客(57)
- 资源 (10)
- 收藏
- 关注

原创 swft入门学习-第二天
开篇通常来说,编程语言教程中的第一个程序应该在屏幕上打印“Hello, world”。在Swift中,可以用一行代码实现 println ("hello, world ")如果你写过C或者Objective-C代码,那你应该很熟悉这种形式——在Swift中,这行代码就是一个完整的程序。你不需要为
2015-03-26 21:11:38
916

原创 swft入门学习-第一天
第一天学习 1.开发界面和Obj-c一样,没有什么区别.1由于本人不喜欢拖拽式开发,所以把storyboard 和XIB 全部给删除了.不过得把注意把 targets->Mian Interface 的指向给删除掉.如果单纯的删除了Main.storyboard 这个文件的话,会造成奔溃的,因为 Mian Interface 找不到指定的文件.
2015-03-25 13:16:05
1305
1

原创 Swft学习 传送门
学Swft朋友 以下是每天学习的传送门,swft入门学习番外篇-创建项目http://blog.youkuaiyun.com/aluoshuai/article/details/44590339持续更新...谢谢
2015-03-24 13:57:26
546

原创 swft入门学习番外篇-创建项目
创建一个简单地项目文件,需要一下几个步骤1.File->New->Project; 新建一个新的项目2.Application->Single View Application; 选着Xocde提供的默认模板,因为只是一个演示的项目,所以不需要太多的UI,所以选择了最基础的一个框架.点击下一步.3.选择项目的名称,现在
2015-03-24 13:30:35
986
原创 IOS 获取视频图片的
获取视频图片的+(UIImage *)getImage:(NSString *)videoURL{ //视频地址 NSURL *url = [[NSURL alloc] initWithString:videoURL];//initFileURLWithPath:videoURL] autorelease]; AVURLAsset *urlAss
2013-11-21 00:06:25
3882
原创 IOS 剪切板
[UIPasteboardgeneralPasteboard]setString:[SettingsManagersharedSettingsManager].promote_Url];
2013-11-21 00:04:58
676
转载 UIActionSheet 按钮不响应点击事件的解决方法
如题,如果在项目中使用了UIActionSheet和UITabBarViewController,那么actionSheet的最底下的一个按钮可能就不会响应你的触摸事件,原因是被tabbar覆盖了,下面是xcode中出现的警告信息:1Presenting action sheet clipped by its superview. Some controls m
2013-11-21 00:03:52
971
转载 利用lipo编译合并iPhone模拟器和真机通用的静态类
转自 CocoaChina会员 “travis” 的博客,原文地址: http://b.imi.im/?p=255如何编译静态类库,大家 已经比较熟悉了,而且现在网上也有很多教程,就不多罗唆了. 现在问题是, 我们编译好了会是两个版本的.a文件 分别用于模拟器和iPhone真机, 因为Mac和iPhone的CPU不同, 才造成了这样的情况. 有点像 PowerMac 和 InterMac.
2013-11-21 00:03:05
739
原创 IOS获取网络图片属性
- (CGSize)getImageSizeWithURL:(NSURL *)url{ CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGFloat width = 0.0f, height = 0.0f; if (imageSource)
2013-04-17 16:42:21
3867
原创 IOS 判断相册是否允许访问
-(void)savedLibrayImage:(UIImage *)image{ ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init]; [library writeImageToSavedPhotosAlbum:image.CGImage orientation:image.imageOrientation comp
2013-04-12 16:05:23
10207
转载 十种排序方法
排序算法有很多,所以在特定情景中使用哪一种算法很重要。为了选择合适的算法,可以按照建议的顺序考虑以下标准: (1)执行时间 (2)存储空间 (3)编程工作 对于数据量较小的情形,(1)(2)差别不大,主要考虑(3);而对于数据量大的,(1)为首要。 主要排序法有: 一、冒泡(Bubble)排序——相邻交换 二、选择排序——每次最小/大排在相应的位置 三
2013-03-15 17:13:36
774
转载 IOS数据离线缓存与读取
方法一:一般将服务器第一次返回的数据保存在沙盒里面。这样在手机断网的情况下可以从本地读取数据了。1.保存到沙盒的代码:[plain] view plaincopy+ (void)saveCache:(int)type andID:(int)_id andString:(NSString *)str; { NSUserDefaults * settin
2013-03-13 10:53:23
946
原创 KVO
//KVO 添加事件绑定 [self addObserver:self forKeyPath:@"token_data" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld context:nil];111[self setValue:deviceToken forKeyPath:@"token_data"]
2013-01-25 15:43:47
456
原创 IOS获取本地时间
获取本地时间NSDateFormatter *webformatter = [[NSDateFormatter alloc] init]; [webformatter setDateStyle:NSDateFormatterBehavior10_4]; NSDate *date = [NSDate dateWithTimeIntervalSince1970:ti
2013-01-11 11:32:46
3624
转载 UIImageView 用法
UIImageView,顾名思义,是用来放置图片的。使用Interface Builder设计界面时,当然可以直接将控件拖进去并设置相关属性,这就不说了,这里讲的是用代码。1、创建一个UIImageView:创建一个UIImageView对象有五种方法:UIImageView *imageView1 = [[UIImageView alloc] init];UIIm
2013-01-09 15:18:27
1061
原创 本地通知UILocalNotification
原文:http://www.cnblogs.com/bandy/archive/2012/03/29/2423555.html//发送通知 UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!=nil) { NSDate
2012-11-23 15:53:04
472
原创 手机震动。。。嘿嘿
导入 #import 引入 AudioToolbox.framework执行AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
2012-10-09 16:23:00
658
转载 动画震动效果,,,嘿嘿。
static int numberOfShakes = 10000;//震动次数static float durationOfShake = 1000.5f;//震动时间static float vigourOfShake = 0.102f;//震动幅度- (CAKeyframeAnimation *)shakeAnimation:(CGRect)frame{ CAKeyfram
2012-10-09 13:37:00
2654
原创 Object-C 获得系统自带的字体
- (void) fonts{for (NSString *familyName in [UIFont familyNames]){NSLog(@"Font Family = %@", familyName);for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]){ NSLog(@"\t%@", fontN
2012-09-11 16:28:29
1061
转载 CATransition 用法
CATransition的type属性 1.#define定义的常量 kCATransitionFade 交叉淡化过渡 kCATransitionMoveIn 新视图移到旧视图上面 kCATransitionPush 新视图把旧视图推出去 kCATransitionReveal 将旧视图移开,显示下面的新视图 2.用字符串
2012-09-07 13:54:31
8851
转载 Objective-C Block语法递归函数实现
两种方法可以实现,一种是参考zenny_chen所说的全局的或都static的block可以实现http://www.cocoachina.com/bbs/read.php?tid-9222-fpage-3.htmlint main(void){ void (^p)(int) = 0; static void (^ const blocks)(int) = ^(int i)
2012-09-04 16:46:54
2291
转载 禁止webview滚动
ios5里面可以用这个设置self.scrollView.scrollEnabled = NO;但是要支持全系列的机器就不能这么干了利用- (void)disableBounce {// [[[self subviews] lastObject] setScrollingEnabled:NO]; for (id subview in self.subviews){ i
2012-08-30 11:43:22
11457
转载 iphone 获取设备型号 设备系统
#import "sys/utsname.h" /*! * get the information of the device and system * "i386" simulator * "iPod1,1" iPod Touch * "iPhone1,1" iPhone * "iPhone1,2" iPhone 3G *
2012-08-23 10:40:24
1916
转载 UIlabel 行高 另类解决办法
//下面两行协助 UIWebView 背景透明化,这两属性可以在 xib 中进行设置webview.backgroundColor = [UIColorclearColor]; //但是这个属性必须用代码设置,光 xib 设置不行webview.opaque = NO; //这行能在模拟器下明下加快 loadHTMLString 后显示
2012-08-21 15:37:23
8133
转载 data和nstring格式互相转换
data和nstring格式互相转换NSString *strToData = @"http://t3.baidu.com/it/u=3279593072,3159455494&fm=52&gp=0.jpg"; NSData *aData = [strToData dataUsingEncoding: NSASCIIStringEncoding]; NSString *dataT
2012-07-30 10:58:45
700
转载 WebView背景阴影消除
for (UIView *subView in [webView subviews]) { if ([subView isKindOfClass:[UIScrollView class]]) { for (UIView *shadowView in [subView subviews]) { if ([shadowView i
2012-07-30 10:58:00
866
转载 手势识别-UITapGestureRecognizer
//单指单击2: UITapGestureRecognizer *singleFingerOne = [[UITapGestureRecognizer alloc] initWithTarget:self3: action:@selector(handleSingleFingerEvent:)];4: singleFingerOne.numberOfTouchesRequired = 1;
2012-07-30 10:57:20
957
原创 通知中心NSNotificationCenter
[[NSNotificationCenter defaultCenter] postNotificationName:@"clickBtn111" object:myTextField.text userInfo:[NSDictionary dictionaryWithObject:myTextField.text forKey:@"name"]]; [[NSNotificationCe
2012-07-30 10:56:22
455
转载 UITableView高度自適應
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { // 列寬 CGFloat contentWidth = self.tableView.frame.size.width; // 用何種字體進行顯示 UIFont *font = [UIFont s
2012-07-20 22:56:49
4562
原创 如何获得系统当前时间 毫秒
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; [dateForma
2012-07-11 16:38:39
1283
原创 获取UIWebView的内容高度
#pragma mark - UIWebview delegete- (void)webViewDidFinishLoad:(UIWebView *)webView{ CGFloat height = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"] floatValue];
2012-07-02 15:55:13
4316
转载 IPhone 之 UIView的一些基本方法理解
init:方法在init方法中实例化必要的对象(遵从LazyLoad思想)init方法中初始化ViewController本身 loadView:方法这是当没有正在使用nib视图页面,子类将会创建自己的自定义视图层。绝不能直接调用。如果手工维护views,必须重载重写该方法。当view需要被展示而它却是nil时,viewController会调用该方法。lo
2012-06-27 12:58:15
538
转载 10层汉诺塔递归解法,过程输出到文件
//10层汉诺塔递归解法,过程输出到文件#include #include using namespace std;ofstream fout("out.txt");void Move(int n, char i, char j){ fout<< "把" << n << "号从" << i << "移动到" << j <<endl; }void Hannoi(int n
2012-06-12 23:12:12
6088
原创 C++实现冒泡排序
//C++实现冒泡排序#include using namespace std;void BubbleSort(int* pData, int Count){ int Temp; for (int i = 1; i < Count; i++) //进行Count次排序,Count是要排序的数的个数 { for (int j = Count - 1; j >= i; j--)
2012-06-12 23:11:33
2413
转载 C++选择排序
//C++选择排序#include using namespace std;void SelectSort(int *pData, int Count){ int iTemp; int iPos; for (int i = 0; i < Count - 1; i++) { iTemp = pData[i]; iPos = i; for (int j = i + 1
2012-06-12 23:10:26
559
转载 ASIHTTPRequest 详解, http 请求终结者
- (void)dealloc{ [request clearDelegatesAndCancel]; [request release]; ... [super dealloc];}==版权归旺财勇士所有~转载需声名今天把这个的官方文档翻译的出来以做分享~让迷途之人有路可寻~ASIHTTPRequest是一款极其强劲的HTTP访问开源项
2012-06-12 23:09:00
315
转载 KissXml API
KissXml API=============================================================================================DDXMLNode(结点类,所有结点类的父类)//创建元素结点的方法+ (id)elementWithName:(NSString *)name;+ (id
2012-05-31 10:11:27
567
原创 UIActivityIndicatorView 使用
//开始处理图片,显示指示器-(IBAction)startEffectChange:(id)sender{ waitView.hidden = NO; //停止用户交互 self.view.userInteractionEnabled=NO; wait = [[UIActivityIndicatorView alloc]initWithActivityIndi
2012-04-12 16:39:48
822
原创 网络加载图片
NSString *aString = @"http://cc.cocimg.com/bbs/attachment/thumb/Fid_12/12_2_52d705803c8c711.png"; NSData *imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:aString]]; UIIma
2012-04-12 16:33:47
474
转载 KissXml 解析
用了 GDATAXML 应该没多大区别 反正能解析就行了第一步: 选中文件列表最上方的工程名 然后点TARGETS 里面的工程名 然后点Build Phase然后点Link Binary With Libraries 然后点下面的加号 搜索 xml 然后添加libxml2.dylib第二步: 还在工程属性界面 搜索 Header Search Paths 然后添加值 /usr/includ
2012-03-07 08:53:14
1458
libopencore-amrnb.a iOS7.1支持armv7,armv7s,arm64版本
2014-12-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人