This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - Client | |
#pragma mark UIWebViewDelegate | |
- (void)webViewDidFinishLoad:(UIWebView *)webView { | |
// Disable user selection | |
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"]; | |
// Disable callout | |
[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (int)sinaCountWord:(NSString*)s{ | |
int i,n=[s length],l=0,a=0,b=0; | |
unichar c; | |
for(i=0;i<n;i++){ | |
c=[s characterAtIndex:i]; | |
if(isblank(c)){ | |
b++; | |
}else if(isascii(c)){ | |
a++; | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)connection:(NSURLConnection *)aConnection didReceiveResponse:(NSURLResponse *)aResponse{ | |
NSHTTPURLResponse* aHttpResponse = (NSHTTPURLResponse*)aResponse; | |
NSLog(@"aResponse[%@]", aHttpResponse.allHeaderFields); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DocumentsPath(name) \ | |
[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:name] |