惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
罗磊的独立博客
F
Fortinet All Blogs
T
Threatpost
Y
Y Combinator Blog
博客园_首页
美团技术团队
Security Latest
Security Latest
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
V
V2EX - 技术
The Cloudflare Blog
L
LINUX DO - 热门话题
博客园 - 司徒正美
Jina AI
Jina AI
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
The Hacker News
The Hacker News
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Latest news
Latest news
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
雷峰网
雷峰网
Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog RSS Feed
W
WeLiveSecurity
D
DataBreaches.Net
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
Know Your Adversary
Know Your Adversary
TaoSecurity Blog
TaoSecurity Blog
S
Securelist
Help Net Security
Help Net Security

博客园 - 英怀

获取当前页面url中的参数 coffeescript+node.js+angular 转 iphone开发资料汇总(很多实用的东东) 给状态条加上图标的代码 设置uiview背景图的方法之一 xcode 4 下找EXC_BAD_ACCESS错误原因 转--如何解决EXC_BAD_ACCESS错误 再转动画实现 用uiwebview打开pdf,word,excel 网络请求侦听工具 整理 被appstore 拒绝审核通过的原因 Capture iPhone Simulator Screenshots 将NSString转换编码集变为GBK或GB2312 转,ios开源程序集 在程序中如何把两张图片合成为一张图片 - 英怀 怎么让一个UIImageView响应点击事件呢 object c 操作date类型 - 英怀 在model view中隐藏键盘代码 iphone view与view翻转的动画效果 使用NSUserDefaults保存简单的用户数据
关于Iphone开发得一些案例及常用知识(转过来的参考用)
英怀 · 2011-08-29 · via 博客园 - 英怀

tabBar透明的效果
http://www.cocoachina.com/bbs/read.php?tid=17815

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];

--------------------------

设置Table Cell的背景图的公用类代码
http://www.cocoachina.com/downloads/video/2010/0521/1531.html

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface UITableViewCell (UITableViewCellExt)

- (void)setBackgroundImage:(UIImage*)image;
- (void)setBackgroundImageByName:(NSString*)imageName;

@end

#import "UITableViewCellExt.h"

@implementation UITableViewCell (UITableViewCellExt)

- (void)setBackgroundImage:(UIImage*)image
{
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.contentMode = UIViewContentModeCenter;
    self.backgroundView = imageView;
    [imageView release];
    
}

- (void)setBackgroundImageByName:(NSString*)imageName
{
    [self setBackgroundImage:[UIImage imageNamed:imageName]];
}
@end

调 用示例:

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [cell setBackgroundImageByName:@"text-background.png"];
        
        
    }
    
    return cell;
}

-------------------------------------
iPhone SDK 解析 xml的官方示例代码
http://www.cocoachina.com/downloads/video/2010/0520/1523.html

----------------------------------------------

图片切成圆角代码
http://www.cocoachina.com/bbs/read.php?tid-1757.html

static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,
                 float ovalHeight)
{
    float fw, fh;
    if (ovalWidth == 0 || ovalHeight == 0) {
    CGContextAddRect(context, rect);
    return;
    }
    
    CGContextSaveGState(context);
    CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect));
    CGContextScaleCTM(context, ovalWidth, ovalHeight);
    fw = CGRectGetWidth(rect) / ovalWidth;
    fh = CGRectGetHeight(rect) / ovalHeight;
    
    CGContextMoveToPoint(context, fw, fh/2);  // Start at lower right corner
    CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);  // Top right corner
    CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1); // Top left corner
    CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1); // Lower left corner
    CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); // Back to lower right
    
    CGContextClosePath(context);
    CGContextRestoreGState(context);
}

+ (id) createRoundedRectImage:(UIImage*)image size:(CGSize)size
{
    // the size of CGContextRef
    int w = size.width;
    int h = size.height;
    
    UIImage *img = image;
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);
    CGRect rect = CGRectMake(0, 0, w, h);
    
    CGContextBeginPath(context);
    addRoundedRectToPath(context, rect, 10, 10);
    CGContextClosePath(context);
    CGContextClip(context);
    CGContextDrawImage(context, CGRectMake(0, 0, w, h), img.CGImage);
    CGImageRef imageMasked = CGBitmapContextCreateImage(context);
    CGContextRelease(context);
    CGColorSpaceRelease(colorSpace);
    return [UIImage imageWithCGImage:imageMasked];
}

直接调用 createRoundedRectImage....
返回圆角图片
圆角大小自行修改 CGContextAddArcToPoint....

-------------------------------
检测iPhone/iPod Touch/iPad设备类型
http://www.cocoachina.com/bbs/read.php?tid-20994.html

-------------------------------------
iPhone上气泡式聊天的代码
http://www.cocoachina.com/downloads/video/2010/0510/1379.html

聊天程序--(UDP通信,bubble代码)
http://www.cocoachina.com/bbs/read.php?tid-24324-fpage-2.html

第一个iphone小程序(实现聊天功能)
http://www.cocoachina.com/bbs/read.php?tid-24956-fpage-2.html
----------------------------------------
ExpanderController可伸缩框架的代码
http://www.cocoachina.com/downloads/video/2010/0510/1368.html
-------------------------------------------
一段模拟水波纹的代码,希望对大家有用
http://www.cocoachina.com/downloads/video/2010/0506/1351.html
-------------------------------
根据经纬度计算两点之间距离的Obcective-C代码
http://www.cocoachina.com/downloads/video/2010/0506/1344.html

其中其中er 就是地球椭球半径,对于google map使用 6378137 就可以了。函数的调用非常简单,几乎使用任何平台:)
#define PI 3.1415926
double LantitudeLongitudeDist(double lon1,double lat1,
                              double lon2,double lat2)
{
    double er = 6378137; // 6378700.0f;
    //ave. radius = 6371.315 (someone said more accurate is 6366.707)
    //equatorial radius = 6378.388
    //nautical mile = 1.15078
    double radlat1 = PI*lat1/180.0f;
    double radlat2 = PI*lat2/180.0f;
    //now long.
    double radlong1 = PI*lon1/180.0f;
    double radlong2 = PI*lon2/180.0f;
    if( radlat1 < 0 ) radlat1 = PI/2 + fabs(radlat1);// south
    if( radlat1 > 0 ) radlat1 = PI/2 - fabs(radlat1);// north
    if( radlong1 < 0 ) radlong1 = PI*2 - fabs(radlong1);//west
    if( radlat2 < 0 ) radlat2 = PI/2 + fabs(radlat2);// south
    if( radlat2 > 0 ) radlat2 = PI/2 - fabs(radlat2);// north
    if( radlong2 < 0 ) radlong2 = PI*2 - fabs(radlong2);// west
    //spherical coordinates x=r*cos(ag)sin(at), y=r*sin(ag)*sin(at), z=r*cos(at)
    //zero ag is up so reverse lat
    double x1 = er * cos(radlong1) * sin(radlat1);
    double y1 = er * sin(radlong1) * sin(radlat1);
    double z1 = er * cos(radlat1);
    double x2 = er * cos(radlong2) * sin(radlat2);
    double y2 = er * sin(radlong2) * sin(radlat2);
    double z2 = er * cos(radlat2);
    double d = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2));
    //side, side, side, law of cosines and arccos
    double theta = acos((er*er+er*er-d*d)/(2*er*er));
    double dist  = theta*er;
    return dist;
}
----------------------------
巴黎自行车信息查询软件源码
http://www.cocoachina.com/downloads/video/2010/0429/1266.html
--------------------------------
自制 iPhone DataGrid 数据列表组件,支持行列锁定
http://www.cocoachina.com/downloads/video/2010/0429/1267.html
--------------------------------
iPhone播放本地视频的代码
http://www.cocoachina.com/downloads/video/2010/0428/1260.html
----------------------------
UIWebView里面长按一个链接后自定义弹出菜单
http://www.cocoachina.com/iphonedev/sdk/2010/0716/1879.html
-------------------------------------------
iPhone上画面切换特效及代码
http://www.cocoachina.com/downloads/video/2010/0419/1123.html
-------------------------
永远的扫雷英雄(开源) 登场
http://www.cocoachina.com/bbs/read.php?tid-12818.html
--------------------------------
在iPhone中实现图片缩放
http://www.cocoachina.com/iphonedev/toolthain/2009/0611/198.html
-----------------
创建iPhone锁定划动条的方法
http://www.cocoachina.com/iphonedev/toolthain/2009/0611/224.html
-------------
UICoverFlowLayer例子:制作iPhone的Cover Flow效果
http://www.cocoachina.com/iphonedev/toolthain/2009/0611/196.html
-----------------------------
如何在iPhone程序读取数据时显示进度窗
http://www.cocoachina.com/iphonedev/toolthain/2009/0611/173.html
-----------------
UITabBarController 保存调整后的more选项(增加所有TabBar之间切换).
http://www.cocoachina.com/bbs/read.php?tid-12424.html
--------------------------------------------
NSStirng、NSArray、以及枚举(Method小集合)
http://www.cocoachina.com/bbs/read.php?tid-7735.html
------------
UIview动画
http://www.cocoachina.com/bbs/read.php?tid-8035-keyword-demo.html

http://www.cocoachina.com/bbs/read.php?tid-11343.html
----------------
搜索功能
http://www.cocoachina.com/bbs/read.php?tid-5869.html

-------------
UILabel显示换行的方法
UILabel*label;

//设置换行
label.lineBreakMode = UILineBreakModeWordWrap;
label.numberOfLines = 0;

换行符还是\n
比如NSString * xstring=@"lineone\nlinetwo"

记得要把label的高度设置的足够显示多行内容。

------------------
手把手教你做iphone的soap应用(webservice)
http://www.cocoachina.com/bbs/read.php?tid-16561-fpage-2.html
---------------------------
点击Table一行弹出下拉一排按钮的TableViewCell类
http://www.cocoachina.com/bbs/read.php?tid-23065-fpage-2.html

http://www.cocoachina.com/bbs/read.php?tid=21494&page=1#131711
-----------------
一些iPhone开源项目代码
http://www.cocoachina.com/bbs/read.php?tid-4532-fpage-2.htm
----------------------
<iOS4>后台运行(Multitasking)以及本地通知(Local Notifications) 有图,有书,有代码,统一打包
http://www.cocoachina.com/bbs/read.php?tid-20423-fpage-2.html
-------------------
开源一个基于MultiTouch事件图片移动和缩放的demo
http://www.cocoachina.com/bbs/read.php?tid-25387-fpage-2.html