Time of Update: 2014-06-11
1、UIWindow的bounds發生變化(Window本身發生了旋轉)iOS 7之前Window的bounds不會隨著方向而變化,但是到了iOS
Time of Update: 2014-06-10
- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)waitperformSelectorOnMainThread:withObject:waitUntilDone:基於預設模式調用主線程中接收器的方法Invokes a method of the receiver on the main thread using the default mode.參數
Time of Update: 2014-06-08
1. 建立一個空iOS應用程式(Empty Application).2. 添加加控制器類. 修改控制器類的viewDidLoad- (void)viewDidLoad{ [super viewDidLoad]; //建立標題 UILabel *header = [[UILabel alloc] init]; header.text = @"歡迎來到我的世界!"; header.textAlignment = NSTextAlignmentCenter;
Time of Update: 2014-06-07
Function 函數 Swift使用func關鍵字來聲明函數,函數通過函數名加小括弧內的參數列表來調用。使用->來區分參數名和傳回值的類型:1 func greet(name: String, day: String) -> String {2 return "Hello \(name), today is \(day)."3 }4 greet("Bob", "Tuesday")練習:remove day參數,增加一個參數,比如:今天的午餐特色菜~1 func
Time of Update: 2014-06-07
KVO的用法註冊[object addObserver:observer forKeyPath:@"text" options:NSKeyValueObservingOptionNew context:nil];實現回調方法-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
Time of Update: 2014-06-03
#import "KUViewController.h"#import "KUProgress.h"@interfaceKUViewController ()<NSURLSessionTaskDelegate>//下載進度的類,繼承UIview@property (weak, nonatomic) IBOutlet KUProgress *progressView; @end @implementation KUViewController
Time of Update: 2014-05-25
C++中為了避免名字定義衝突,特別引入了“名字空間的定義”,即namespace。當代碼中用時,輸出可直接引用cout繼承C語言的標準庫檔案,未引入名字空間定義,所以可直接使用。當代碼中引入時(C++標準),輸出需要引用std::cout執行個體:code1#include "stdafx.h"#include using namespace std;int main(void){int
Time of Update: 2014-05-25
IOS 中擷取系統版本,比較簡單([[UIDevicecurrentDevice] systemVersion]);看到網路上很多轉化系統字串到float 的方法,都是使用 [[[UIDevice currentDevice] systemVersion] floatValue]; 但是這個方法我遇到一個問題,就是如果系統版本是7.1.1 的時候,轉化產生的float 有問題,我debug 產生的資料為7.0899999999999。導致出現了問題,後來為瞭解決這個問題,我自己寫了一個方法。
Time of Update: 2014-05-17
runtime反射屬性列表:把反射屬性的用法說完。。。IOS網路請求大家應該很不陌生了把,但有時候我們需要向伺服器傳遞的資料比較多,這個時候,也是我們runtime發揮的時候了。直接上代碼,童鞋們估計快該罵人了。一個反射屬性,講這麼久。。。 -(void)createPostDateWithDic{ NSArray * arr = [self.requestDictionary allKeys]; for (int i = 0; i < arr.count; i ++
Time of Update: 2014-05-14
打地鼠遊戲ios源碼,打地鼠遊戲源碼,遊戲是一款多關卡基於cocos2d的iPad打地鼠遊戲源碼,這也是一款高品質的打地鼠遊戲源碼,可以擁有逐步上升的關卡的設定,大家可以在關卡時設定一些商業化的模式來盈利的,非常完美的一款完整版休閑類遊戲源碼。<ignore_js_op> <ignore_js_op> <ignore_js_op> <ignore_js_op> 詳細說明:http://ios.662p.com
Time of Update: 2014-05-13
- (UIColor *)colorAtPixel:(CGPoint)point { // Cancel if point is outside image coordinates if (!CGRectContainsPoint(CGRectMake(0.0f,0.0f, self.size.width,self.size.height), point)) { return nil; } NSInteger pointX = trunc(point.x);
Time of Update: 2014-05-13
iOS 人機互動指導方針(iOS Human Interface Guidelines)太陽火神的美麗人生 (http://blog.csdn.net/opengl_es)本文遵循“署名-非商業用途-保持一致”創作公用協議轉載請保留此句:太陽火神的美麗人生 - 本部落格專註於 敏捷開發及移動和物聯裝置研究:iOS、Android、Html5、Arduino、pcDuino,否則,出自本部落格的文章拒絕轉載或再轉載,謝謝合作。UI 設計基礎 UI Design Basics為 iOS 7 設計
Time of Update: 2014-05-09
在Cocoa Touch架構中,有UIApplication、UIAccelerimeter、NSUserDefaults和NSNotificationCenter等單例類。另外,NSFileManager和NSBundle類雖然屬於Cocoa架構的內容,但也可以在Cocoa
Time of Update: 2014-04-28
IOS 的動畫放大與縮小,並非按照找它的中心點放大和縮小,而是左上方 。我分析了下原來是Autolayout 與View Transforms的衝突造成的。 - () addSubviewWithZoomInAnimation:(UIView*)view duration:(CGAffineTransform trans = CGAffineTransformScale(view.transform, , = trans; [UIView animateWithDuration:
Time of Update: 2014-04-19
轉載請註明來源:http://blog.csdn.net/wanggsx918/article/details/23833425#import "UIImage+OpenCV.h"#import "MyViewController.h"#import #import #import #import #import @interface MyViewController ()- (void)processFrame;@end@implementation
Time of Update: 2014-04-18
iOS中UIView的動畫ViewController1.h#import @interface ViewController1 : UIViewController@property(nonatomic,retain)UIView* view1;@endViewController1.m#import "ViewController1.h"@interface ViewController1 ()@end@implementation ViewController1-
Time of Update: 2014-04-18
UIScrollView 常用屬性scrollView.maximumZoomScale= 2.0; // 縮放最大比例scrollView.minimumZoomScale = 0.2;// 縮放最小比例scrollView.contentSize= self.view.frame.size +10;// 設定內容大小scrollView.pagingEnabled=YES; // 允許分頁 預設NOscrollView.scrollEnabled=YES; //
Time of Update: 2014-04-18
匯入MediaPlayer.framework,引入標頭檔#import - (void)createMPPlayerController:(NSString *)sFileNamePath { NSURL *url = [NSURL URLWithString:sFileNamePath]; MPMoviePlayerViewController *playViewController=[[MPMoviePlayerViewController alloc]
Time of Update: 2014-04-17
BUG描述:Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()處理方法:在target的Build Settings裡面,將Build ActiveArchitecture Only改成YES處理結果:成功運行其他方法:1.更改代碼將
Time of Update: 2014-04-13
//// IdGenerator.m// Copyright (c) 2014年 青島拓宇網路科技有限公司. All rights reserved.//#import "IdGenerator.h"static long long time_stamp = 0;static long long time_stamp_now = 0;static NSMutableArray *temp = NULL;static NSNumber *random_n = NULL;static