Time of Update: 2014-10-30
資料持久化-Plist檔案寫入,-plist寫入資料持久化,常見4種:歸檔,plist檔案,sqlite,coreData.今天複習的是plist檔案讀寫.//// ViewController.m// Test_Plist//// Created by lidongbo on 14/10/30.// Copyright (c) 2014年 lidongbo. All rights reserved.//#import "ViewController.h"@interface
Time of Update: 2014-10-30
從零開始學習Object-C---第四天,object-c---第四天今天主要講解Object-C的資料類型和運算式的使用,Object-C的四種基礎資料型別 (Elementary Data Type):int, float, double,
Time of Update: 2014-10-28
iOS動畫簡介在iOS上實現動畫效果,基本都是在一段給定的時間內完成狀態的連續變化,包括背景色、Frame大小、位移、旋轉、透明度、縮放等。老的動畫實現形式:iOS 4.0之前,蘋果提供的是類似於資料庫中的事務編程的模式:例如實現一個view的淡入效果,可以通過設定view的alpha實現(alpha = 1是全透明): [UIView beginAnimations:nil context: nil]; [UIView setAnimationDuration:1.0
Time of Update: 2014-10-28
IOS強化知識(1)認識Objective-C 一直想寫一個整體的Objective-C的文章,總是沒時間,所以我想把大知識變小,小知識變更小,每天寫一點點,來把自己學習的東西與大家分享,好了廢話不多說。1、一門動態語言OC Object-C(以下簡稱OC)是一門物件導向語言,這恐怕學過編程的人都知道。但是OC跟其他語言相比,顯得格格不入。因為它是一門訊息結構語言,而非函數調用。所以文法上顯得很怪,通常是這樣: [對象訊息];
Time of Update: 2014-10-28
iOS設計模式 - (2)UML類間關係精解在正式講設計模式之前, 介紹一下UML類圖之間的關係還是很有必要的, 因為一些教程, 書籍, 包括我之後的文章, 都會大量使用類圖, 去描述各個類之間的關係。這是一種非常直觀, 簡約的方式。當然, 能力, 精力有限, 這裡的UML的介紹也僅僅局限與幾種常見的類間關係。包括: 繼承、實現、依賴、關聯、彙總、組合 在次之前, 如果看不懂類圖, 可以先看一下我之前寫的一篇文章 : 詳解八大UML類圖符號的標記法 &
Time of Update: 2014-10-26
顏色的賦值(新奇寫法),賦值寫法 //寫法比較新奇 UIColor *bgColor =[UIColor redColor]; self.view.backgroundColor = bgColor; 同學錄的留言有什新奇的寫法?非主流 ...有緣再相會, ...沖淡的是回憶,不變的是友誼;詛咒你;一輩子幸福!不許不快樂,不然饒不了你! ...安靜結束,也是一種對待
Time of Update: 2014-10-27
URBAlerViewDemo,listviewdemo :工程圖:注意:此檔案要加入第三主庫URBAlertView.RootViewController.m//點擊任何處,出現提示框-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ URBAlertView *alertView = [URBAlertView dialogWithTitle:@"Test Dialog" subtitle:
Time of Update: 2014-10-24
iOS開發之CocoaPods(objective-c第三方庫管理工具)介紹:iOS開發中,大多數情況下,我們都需要整合一些第三方依賴庫,對於一個稍大的項目,用到的第三方依賴庫的數量也非常可觀。CocoaPods是objective-c第三方庫管理工具,方便第三方庫的管理。用法:1. 安裝$ sudo gem install cocoapods更新cocoaPodsgem update cocoapod如果gem不是最新的的,執行命令sudo gem update --system2.
Time of Update: 2014-10-24
iOS中堆和棧的區別,iOS區別堆和棧的區別主要有以下五點:1、管理方式:對於棧來講,是由編譯器自動管理,無需我們手工控制;對於堆來講,釋放工作由程式員控制,容易產生memory
Time of Update: 2014-10-24
iOS導航控制器和標籤欄控制器的結合- (void)initTabBar{ // 初始化首頁 HomePageViewController *homePage = [[HomePageViewController alloc]init]; UINavigationController *homePageNav = [[UINavigationController alloc]initWithRootViewController:homePage]; //
Time of Update: 2014-10-23
ios開發-單例抽取宏,ios開發抽取宏在日常開發中,我們經常會用到宏,宏本質上就是在編譯的時候,替換代碼樣本1://##可以用於拼接宏中的變數名#define demo(xxx) int##xxx"main(){ int intA = 10; int intB = 20; NSLog(@"======%d",demo(A) + demo(B));} 開發中怎使用單例
Time of Update: 2014-10-23
ios開發-常用網路,ios開發網路直接上代碼樣本:-(void)touchesBeGan:(NSSet *)touches withEvent:(UIEvent *)event{ //1.url NSURL *url = [NSURL URLWithString:@"http://m.baidu.com"]' //2.request NSURLRequest *request = [NSURLRequest requestWithURL:url]; //3.發送網路連接 擷取位元據
Time of Update: 2014-10-22
仿鋼琴的聲音,仿鋼琴聲音 :當點擊按鈕的時候,會播放相應的鋼琴的聲音。此代碼需要引入庫AudioToolbox.framework.此為工程目錄:RootViewController.h#import <UIKit/UIKit.h>//加入標頭檔#import <AudioToolbox/AudioToolbox.h>@interface RootViewController : UIViewController{ NSString *soundFile;
Time of Update: 2014-10-22
IOS
Time of Update: 2014-10-22
加號增加書架,減號減少書架(code4App),書架code4app 開始時候的:點擊增加時候的:點擊減少時候的:ReaderViewController.h#import <UIKit/UIKit.h>@interface ReaderViewController : UIViewController<UIScrollViewDelegate>{ UIScrollView *scrollView;}@property(nonatomic,strong)
Time of Update: 2014-10-21
底下滾動,上邊標題也會跟著滾動(仿環球時報),標題環球時報 選擇第一個的:選擇第二個的:項目目錄:注意本代碼引入了第三方庫SVSegmentedControlRootViewController.h#import <UIKit/UIKit.h>#import "SVSegmentedControl.h"@interface RootViewController : UIViewController<UIScrollViewDelegate>{
Time of Update: 2014-10-22
iCarouselDemo,icarousel :項目結構:RootViewController.h#import <UIKit/UIKit.h>#import "iCarousel.h"@interface RootViewController : UIViewController<iCarouselDelegate,iCarouselDataSource>{ iCarousel *
Time of Update: 2014-10-21
清風註解-Swift程式設計語言:Point6~10,-swiftpoint6目錄索引清風註解-Swift程式設計語言 Point 6.輸出常量和變數代碼案例:// 輸出的內容會在最後換行println("hello, world")// 輸出的內容最後不會換行print("My name is Dash Geng")註解:可以用 println 或 print 函數來輸出當前常量或變數的值。println 和 print 是用來輸出的全域函數(內建函數)。println
Time of Update: 2014-10-21
DCPathButtonDemo(按鈕的動畫效果), 開始:點擊button後:工程目錄:工程詳細目錄:RootViewController.h#import <UIKit/UIKit.h>//加入標頭檔#import "DCPathButton.h"@interface RootViewController : UIViewController<DCPathButtonDelegate>@end RootViewController.m -
Time of Update: 2014-10-20
Swift與Objective-C的對比,SwiftObjective-CWWDC 2014上蘋果再次驚世駭俗的推出了新的程式設計語言Swift 雨燕, 這個訊息會前沒有半點鐘風聲的走漏。訊息發布當時,會場一片驚呼,相信全球看直播的碼農們當時也感覺腦袋被敲了一記悶棍吧。於是熬夜學習了Swift大法, 越看越想高呼 ”