自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(56)
  • 收藏
  • 关注

转载 UIWebView 显示本地html及引用资源

有些软件中可能会用到html页面,比如用在做帮助页面或者其它相关信息时。 这种情况下只需要将html页面文件以及索引用到的资源(图片、声音等) 都加入到bundle中,或者单独创建一个bundle, 在需要的时候调用UIWebView的相关方法即可NSBundle* bundle = [NSBundle mainBundle];NSString* resPath = [bunder res

2012-02-13 20:30:53 1986

原创 UIWebView如何打开本地的网页

1,在xib文件中加入UIWebView控件。连接Controller中的对应的IBOutlet。@interface AboutViewController : UIViewController { IBOutlet UIWebView *webView;}@property(nonatomic,retain) UIWebView *webView;@end2,将html文

2012-02-13 17:41:36 3263

转载 Xcode中下载和使用离线文档

1. 在Xcode的Preference菜单中选Downloads-Documentation,点击希望下载的文档,点左下角的上箭头图标,展开该项目的详细信息。2. 在详细信息中找到Feed地址,用Safari浏览器访问该地址,例如iOS 5的文档http://developer.apple.com/rss/com.apple.adc.documentation.AppleiPhone5_0.

2012-02-13 15:04:33 2081

转载 Mac系统下显示隐藏文件

显示隐藏文件:defaults write com.apple.finder AppleShowAllFiles -bool trueKillAll Finder恢复隐藏defaults write com.apple.finder AppleShowAllFiles -bool falseKillAll Finder

2012-02-13 15:03:44 673

转载 Xcode 4.1/4.2/4.2.1 免证书(iDP)开发+真机调试+生成IPA全攻略

开发环境使用的是目前为止最新的稳定版软件:Mac OS X Lion 10.7 + Xcode 4.1目前Xcode 4.2 Preview版也已经发布,据说其修改方法跟4.1非常类似,只改动了一行代码,请参看参考文章的第二篇。本文仍以4.1版本为例。更新:现在Xcode 4.2正式版和iOS 5均已发布,下面补充上4.2的修改方法。(2011-10-24)各步骤会标明版本,比如(Xc

2012-02-13 14:56:12 900

原创 ScrollView Image ZOOM

[scrollView2 setMinimumZoomScale:1.0];[scrollView2 setMaximumZoomScale:4.0];[scrollView2 setDelegate:self];-(UIView *)viewForZoomingInScrollViewUISc

2012-02-13 14:33:23 1150

转载 在scrollview中双击定点放大的代码

双击放大是 iPhone 的一个基本操作,第三方程序里引入这一功能的话,主要是在 scrollview 呈现一张图片或者 PDF 页面时,双击可以放大,主要代码如下- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale{    NS

2012-02-13 00:05:50 1034

转载 细说UIScrollView上的Touch 事件

1 开篇最近在项目中遇到一个 需求就是在一个可以左右拨动的页面上,添加一些交互功能,比如说点击某个页面会有文字变化,图片变换,最后有比较特殊的需求是做个像slider功能的可以拖动的按钮,并且有吸附功能,即当滑动停止在两个图标间的时候,可以滑向离自己比较近的图标。(PS:本人是新手,哈哈,高手就全当路过吧),一看到的时候觉的没什么问题,很简单的不就是一个scrollview+t

2012-02-13 00:04:18 705

转载 修改navigation Bar 中部的title内容

如果建立的是NavigationBar就是。NavigationBar.topItem.title = @"your title";如果是NavigationController。。那就是self.navigationItem.title  = @"your title";

2012-02-11 21:30:04 1265

原创 修改NavigationController中backbutton

在父viewController中如下设置:    UIBarButtonItem *backbutton = [[UIBarButtonItem alloc]init];    backbutton.title = @"返回列表";    self.navigationItem.backBarButtonItem = backbutton;    [backbutton re

2012-02-11 19:36:09 5086

转载 @selector 里面的方法名加参数

iPhone: NSTimer and that thing called userInfoTuesday, May 12, 2009   As I am implementing some stuff, I had reason to send along some information to a NSTimer's "onComplete" method. Eve

2012-02-08 14:05:27 5198

转载 iPhone NavigationBar和UIToolbar基础

navigation bar 分为三个部分,左按钮,右按钮和中间的View.在Controller中可以通过以三个方式来引用: self . navigationItem. titleViewself . navigationItem. leftBarButtonItemself . navigationItem. rightBarButtonItem左右按

2012-02-08 00:58:43 925

转载 改变导航条样式

转载 http://hua397.iteye.com/blog/11812991.背景色:(http://stackoverflow.com/questions/2259929/iphone-navigationbar-custom-background)网上说用category给UINavigationBar重写drawRect:@implementation UINav

2012-02-08 00:56:52 1142

转载 从零开始开发iPhone,教你如何在真机调试iPhone应用程序

钥匙串访问(Keychain Access)工具打开主菜单- 证书助理(Certificate Assistant)-从证书代理请求证书(Request a Certificate From a Certificate Authority)输入iDP注册时的email,用户名自定义,选择“存储到磁盘”,选择‘Let me specify key pair information’。选择

2012-02-05 22:30:30 948

转载 iPhone Tutorial: Adding a search bar in TableView

So to start create a new ViewBased Project and name it as MySearchScreenApp. You can start with any template you want but you can find in my previous posts why I always start with the most basic templ

2012-02-03 00:42:12 869

转载 __week and autorelease pool in ARC in Xcode 4.2

NSString __weak *string;@autoreleasepool { string = [NSString stringWithFormat:@"%@", @"AAA"];}NSLog(@"string: %@", string);it outputs as the following what you want.string: (null)

2012-01-08 01:27:28 1247

转载 Automatic Reference Counting

Friday Q&A 2011-09-30: Automatic Reference CountingSince the moment Apple announced it, readers have asked me to write about Automatic Reference Counting, or ARC. Today is the day. I'll talk about A

2012-01-08 01:26:19 5262

转载 Transitioning to ARC Release Notes

Automatic Reference Counting (ARC) is a compiler feature that provides automatic memory management of Objective-C objects. Rather than having to think about about retain and release operations, ARC al

2012-01-07 22:53:18 1401

转载 Automatic Reference Counting

Automatic Reference Counting1. About this document1.1. Purpose1.2. Background2. General3. Retainable object pointers3.1. Retain count semantics3.2. Retainable object pointers as operan

2012-01-06 23:14:24 995

转载 Automatic Reference Counting

LLVM HomeClang InfoAboutFeaturesComparisonsRelated ProjectsUser's ManualLanguage CompatibilityLanguage ExtensionsC++ StatusClang DevelopmentGet StartedGet InvolvedOpen ProjectsClang InternalsH

2012-01-06 23:13:16 1651

转载 Automatic Reference Counting

Automatic Reference Counting1. About this document1.1. Purpose1.2. Background2. General3. Retainable object pointers3.1. Retain count semantics3.2. Retainable object pointers as operan

2012-01-06 23:12:15 2578

转载 How to use the Segmented Control

Here is How You Use the Segmented Control [UISegmentedControl]by MattjDrake on SEPTEMBER 15, 2009 in CODE TIPSA segmented control displays a list of options that a user can choose from.

2012-01-01 14:43:19 1410

转载 我想做那个在路边鼓掌的人

我想做那个在路边鼓掌的人                        作者:寒心    我那上国中的女儿,她同学都管叫她23号。她的班上总共有50个人,而每次考试,女儿都排名23。久而久之,便有了这个雅号,她也就成了名副其实的中等生。我们觉得这外号刺耳,女儿却欣然接受。老公发愁地说,一碰到公司活动,或者老同学聚会,别人都对自家的'小超人'赞不绝口,他却只能扮深沉。 人家的孩子,不仅成绩出类拔

2011-12-24 09:37:27 1483

转载 将NSString转换编码集变为GBK或GB2312

NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);NSString *retStr = [[NSString alloc] initWithData:data encoding:enc];附:编码集列表CFStringEncod

2011-12-12 21:47:35 3506

转载 iphone:html中文nsdata->nsstring乱码

NSStringEncoding strEncode = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); NSString *strReceive = [[NSString alloc] initWithData:receivedData encoding:strEncode];

2011-12-11 00:50:53 2557 1

转载 How to use NSJSONSerialization

Your code seems fine except the result is an NSArray, not an NSDictionary, here is an example:The first two lines just creates a data object with the JSON, the same as you would get reading it

2011-12-11 00:45:36 1983

转载 远程读取中文网页内容并显示, keyword: html, stringWithContentsOfURL encoding

远程读取中文网页内容并显示, keyword: html, stringWithContentsOfURL encoding   实现的功能很简单,就像远程抓取www.baidu.com的网页内容,就像在浏览器里view->source看到的内容。最初的代码:UITextView *web = [[UITextView alloc

2011-12-11 00:43:59 1580

转载 iPhone UITableView异步加载图片

// Customize the appearance of table view cells.- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {        static NSString *CellIdent

2011-11-28 21:41:09 1312

转载 iPhone UITableView异步加载图片

//AsyncImageView.h#import @interface AsyncImageView : UIView {        NSURLConnection*connection;        NSMutableData*data;}- (void)loadImageFromURL:(NSURL*)url;

2011-11-28 21:25:19 2020 1

转载 Labels aligning in UITableViewCell

I use UITableView with cells created using UITableViewCellStyleSubtitle. Every cell's height is dynamically adjusted using the- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(N

2011-11-28 20:51:47 879

转载 iPhone Programming: Set UITableView Accessory Arrow Style

The iPhone SDK provides an easy-to-code standard for creating consistent user interfaces. The UITableView class is used in many iPhone applications. Most applications that present information to you i

2011-11-25 14:14:49 2119

转载 property 属性讲解

property 后面括号中的属性(nonatimic,retain,assign,copy,readonly,readwrite,)这些属性主要事完成getter setter 的操作  (这个很重要的哦 !!!很多初学者都在这里迷惑哦~~~) ------------------------------------------------assign: 简单的赋值  不会更改索引计

2011-11-24 21:16:04 803

转载 iphone-plist-tutorial

Many people transfer data to and from web services to the iPhone via JSON. This is a much better way than using XML. Parsing XML on the iPhone just plain sucks. It’s overly complicated and super confu

2011-11-24 16:43:03 646

原创 Loading data from .plist files

Saving and Reloading from .plist files…A great way to store dictionary data that does not change during runtime is in a .plist file. Say you want to organize some data hierarchically or you want t

2011-11-24 13:14:44 628

转载 Display Rich Text Using a UIWebView

A UITextView is great for displaying multiple lines of simple text. But when you need something more fancy, like headlines or highlighting text, then you should look at UIWebView. It’s not just capabl

2011-11-22 10:31:04 835

转载 XCode4.2中使用Empty Application模板替代旧的Window Based Application

“FYI, I am very newbie in iPhone development.”I had upgraded Xcode to 4.2 beta 4 and realised that there is no more templates for iOS 4.Obviously, it did not include iOS 4 SDK because it said “w

2011-11-22 10:27:15 1102

转载 how can i detect the touch event of an UIImageView

A UIImageView is derived from a UIView which is derived from UIResponder so it's ready to handle touch events. You'll want to provide the touchesBegan, touchesMoved, andtouchesEnded methods

2011-11-22 10:19:24 671

转载 How to use custom delegates in Objective-C

You will want to declare a delegate protocol for your class. An example of a delegate protocol and interface for class Foo might look like this:view plain@class Foo;  @protocol FooDelegate   @opti

2011-11-22 10:18:47 406

转载 IOS error 汇总

error: Semantic Issue: Interface type cannot be statically allocated?You're probably missing '*' before imageWithCaptionController, your line should beUIViewController *imageWithCaptionContr

2011-11-22 10:18:15 449

转载 How to convert from int to string in objective c

view plainint x = [my1 intValue];   int y = [my2 intValue];   int sum = x+y;  //myT = [NSString stringWithFormat:@"%d", sum];  myT = [[NSNumber numberWithInt:sum] stringValue];    if(myT==@"10" || myT

2011-11-22 10:17:41 641

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除