[NSURLConnectionsendAsynchronousRequest:requestqueue:[[NSOperationQueuealloc]init]compl...
[NSURLConnectionsendAsynchronousRequest:requestqueue:[[NSOperationQueuealloc]init]compl...
應(yīng)用場(chǎng)景:當(dāng)一個(gè)類的某些功能需要由別的類來實(shí)現(xiàn),但是又不確定具體會(huì)是哪個(gè)類實(shí)現(xiàn)。 優(yōu)勢(shì):解耦合 敏捷原則:開放-封閉原則 實(shí)例:tableview的 數(shù)據(jù)源delegate,...
應(yīng)用場(chǎng)景:工廠方式創(chuàng)建類的實(shí)例,多與proxy模式配合,創(chuàng)建可替換代理類。 優(yōu)勢(shì):易于替換,面向抽象編程,application只與抽象工廠和易變類的共性抽象類發(fā)生調(diào)用關(guān)系。...
//設(shè)置seachbar的取消按鈕 - (void)searchBarTextDidBeginEditing:(UISearchBar*)searchBar { [searc...
NSHTTPCookieStorage*cookieJar = [NSHTTPCookieStoragesharedHTTPCookieStorage]; NSArray*c...
隱藏textField隱藏光標(biāo) _textFiled.tintColor=[UIColor clearColor]; 同理可以改變textFiled光標(biāo)的顏色
當(dāng)更改父view的frame時(shí),在有些情況下子view的frame也發(fā)生了變化。這種情況并不都是自己想要的。解決方法如下: [父view setAutoresizesSubv...
- (NSString*)firstCharactor:(NSString*)aString { //轉(zhuǎn)成了可變字符串 NSMutableString*str = [NSMu...
viewTableView =[[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyle...
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selec...
"&" 和"&&" 的區(qū)別; 單個(gè)"&",左邊無論真假,右邊都進(jìn)行計(jì)算。 雙個(gè)"&",左邊為假,右邊不進(jìn)行計(jì)算。 "|"和"||" 的區(qū)別; 單個(gè)"|",左邊無論真假,右邊都...
json字符串轉(zhuǎn)字典 +(id)toArrayOrNSDictionary:(NSString*)NOjsonString { if(NOjsonString.length=...