Time of Update: 2015-05-31
IOS 網路程式開發時資料監控開發網路程式時,我們能夠直觀看到往來資料,對開發是十分便利的。這裡提供了幾種方法:一、虛擬網卡1.在iPhone或iPad上建立一個RVI(remote virtual interface)虛擬網卡用usb把裝置和mac相串連,開啟命令列工具,輸入命令: rvictl -s
Time of Update: 2015-05-31
即時通訊UI-聊天介面(UITableView顯示左右兩人聊天),ui-uitableview目錄1.建立UITableView對象並設定相關屬性2.建立cellModel模型//枚舉類型typedef enum { ChatMessageFrom = 0,//來自對方的訊息 ChatMessageTo //發給對方的訊息 }ChatMesageType;#import <Foundation/Foundation.h>@interface
Time of Update: 2015-05-31
iOS_字串顯示不同顏色最近寫代碼需要根據不同的內容顯示不同的顏色。在這裡mark一下。設定顏色: NSString *contentStr = @"簡介:hello world"; NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:contentStr]; //設定:在0-3個單位長度內的內容顯示成紅色 [str
Time of Update: 2015-05-31
iOS開發 - 最常用控制項
Time of Update: 2015-05-30
ios觸屏事件指南 這篇文章主要給大家總結介紹了2種實現ios觸屏事件的方法,簡單實用,有需要的小夥伴可以參考下。 代碼如下: //在一個函數裡面(初始化等)裡面添加要識別觸摸事件的範圍 infoView=[[UIView alloc] initWithFrame:CGRectMake(20, 100,220, 280)];//範圍,出了這個範圍就檢測不到觸摸了 infoView.backgroundColor=[UIColor
Time of Update: 2015-05-30
Swift基礎文法之變數函數,swift文法變數import Foundation//變數聲明使用//使用 let 來聲明常量,使用 var 來聲明變數 常量只能為它賦值一次let name="cuiyw";var age:Int=20;//聲明時類型是可選的,聲明的同時 賦值的話,編譯器會自動推斷類型var money:Double=200.0;//有一種更簡單的把值轉換成字串的方法:把值寫到括弧中,並且在括弧之前寫一個反斜線let
Time of Update: 2015-05-28
iOS 淺談本地通知 UILocalNotification1、建立本地通知UILocalNotification *local = [[UILocalNotification alloc] init];2、設定通知顯示的時間local.fireDate = [NSDate date];3、設定預設時區local.timeZone = [NSTimeZone defaultTimeZone];4、設定提示內容local.alertBody =
Time of Update: 2015-05-30
[oc學習筆記]不可變數組,oc學習筆記 NSArray *aa = [[NSArray alloc]init]; NSArray *aaa = [NSArray array]; //聲明單個內容數組 NSArray *aaaa = [NSArray arrayWithObject:@"sd"]; //聲明多個內容數組 NSArray *arr = [NSArray arrayWithObjects:@
Time of Update: 2015-05-28
iOS開發之圓角指定如果需要將UIView的4個角全部都為圓角,做法相當簡單,只需設定其Layer的cornerRadius屬性即可(項目需要使用QuartzCore架構)。而若要指定某幾個角(小於4)為圓角而別的不變時,這種方法就不好用了。對於這種情況,Stackoverflow上提供了幾種解決方案。其中最簡單優雅的方案,就是使用UIBezierPath。下面給出一段範例程式碼。UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(1
Time of Update: 2015-05-27
Delivering touch events to a view outside the bounds of its parent view(來自官方文檔),Q: My view is displayed correctly on the screen, but does not receive any touch events. Why is that?A: The most common cause of this problem is because your view is
Time of Update: 2015-05-26
iOS開發 - UIPageControl實現分頁圖片輪播器分頁相關屬性只要將UIScrollView的pageEnabled屬性設定為YES,UIScrollView會被分割成多個獨立頁面,裡面的內容就能進行分頁展示一般會配合UIPageControl增強分頁效果,UIPageControl常用屬性如下 一共有多少頁@property(nonatomic) NSInteger numberOfPages;當前顯示的頁碼@property(nonatomic) NSInteger
Time of Update: 2015-05-26
ios 修改工程名稱,程式名稱(xcode6.3)第一步:修改工程檔案夾名稱第二步:開啟新檔案夾,將.xcodeproj更名,右鍵點擊.xcodeproj並選擇Show package contents,彈出一個對話方塊包含了幾個檔案.(事實上.xcodeproj是這幾個檔案打成的包)第三步:用textEdit開啟 project.pbxproj檔案,將所有舊名字替換成為新的 第四步:把相應的檔案夾名改成工程名,第五步:這個時候可能會發現工程變成了mac
Time of Update: 2015-05-24
TCP與UDP區別,TCPUDP區別TCP與UDP區別TCP與UDP區別TCP---傳輸控制通訊協定,提供的是連線導向、可靠的位元組流服務。當客戶和伺服器彼此交換資料前,必須先在雙方之間建立一個TCP串連,之後才能傳輸資料。TCP提供逾時重發,丟棄重複資料,檢驗資料,流量控制等功能,保證資料能從一端傳到另一端。UDP---使用者資料包通訊協定,是一個簡單的面向資料報的運輸層協議。UDP不提供可靠性,它只是把應用程式傳給IP層的資料報發送出去,但是並不能保證它們能到達目的地。由於UDP在傳輸資料報
Time of Update: 2015-05-23
一個巧妙的實現懸浮的tableViewHeader的方法,table邊框之前因為工作需要要實現一個類似的懸浮+視差的headerView的效果,研究了好久沒研究出來怎麼做,最後用UICollectionView
Time of Update: 2015-05-23
ios開發中兩個常見問題解決方案 ios開發中兩個常見問題解決方案來啦!大家知道蘋果手機使用的是ios系統,而且使用者量很龐大,所以ios開發也成了很熱門的行業。下文小樂哥給大家帶來ios開發中兩個常見問題解決方案,希望給技術員在ios開發中起到協助作用! ios開發中兩個常見問題解決方案 一、“Unknown class XXViewController in Interface Builder
Time of Update: 2015-05-24
Objective-C之優雅的命名,objective-c命名There are only two hard things in Computer Science: cache invalidation and naming things.在電腦科學中只有兩件難事:緩衝失效和命名。— Phil
Time of Update: 2015-05-22
iOS Programming Web Services and UIWebView,iosuiwebviewiOS Programming Web Services and UIWebViewThe work is divided into two parts. The first is connecting to and collecting data from a web service and using that data to create model objects. The
Time of Update: 2015-05-22
iOS懶載入懶載入,英文名LazyLoad。也稱為消極式載入,即在需要的時候才載入(效率低,佔用記憶體小)。所謂懶載入,寫的是其get方法。不必將建立對象的代碼全部寫在viewDidLoad方法中,代碼的可讀性更強。每個控制項的getter方法中分別負責各自的執行個體化處理,代碼彼此之間的獨立性強,松耦合。 一定要先判斷是否存在。 下面是範例程式碼 @interface ViewController () @property (nonatomic,strong)
Time of Update: 2015-05-22
iOS 判讀是否登入 直接代碼//// ismyRight.h// panGuChina//// Created by taogu on 15/5/9.// Copyright (c) 2015年 com.taogucn.www. All rights reserved.// #import @interface ismyRight : UIView@property (nonatomic, strong) UILabel *
Time of Update: 2015-05-21
iOS