<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>““我”的开发笔记” 的评论</title>
	<atom:link href="http://c.gzl.name/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://c.gzl.name</link>
	<description>IPhone, Cocoa, PHP, Javascript, JQuery, Actionscript, etc...</description>
	<lastBuildDate>Mon, 23 Aug 2010 11:20:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Cynric 关于 作者 的评论</title>
		<link>http://c.gzl.name/about/comment-page-1#comment-1459</link>
		<dc:creator>Cynric</dc:creator>
		<pubDate>Mon, 23 Aug 2010 11:20:28 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?page_id=2#comment-1459</guid>
		<description>请教一个问题，最近在做一个项目。一个类似电子杂志的项目。因为客户需求，如果用pdf做的话怕影响效率。就把pdf转成分辨率较高的图片，一次读取三个，这样画面上最多就加载三个图片。我使用了UIScrollView的嵌套，一个负责缩放，一个负责翻页。现在的问题是，当负责缩放的View的zoomScale放大的时候，划过屏幕相应的第一个事件是翻页，而不是移动当前的画面。请教如何解决。附上代码：//
//  MagazineTestViewController.m
//  MagazineTest
//
//  Created by Cynric on 10-8-20.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import &quot;MagazineTestViewController.h&quot;
#import &quot;Manager.h&quot;


@implementation MagazineTestViewController
@synthesize scrollView;

/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
//	scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,768,1024)];
	
	self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
	[scrollView setCanCancelContentTouches:NO];
	scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
	scrollView.clipsToBounds = YES;		
	scrollView.scrollEnabled = YES;
	scrollView.pagingEnabled = YES;
	
		//[self.view addSubview:scrollView];
	
	NSUInteger i;
	
	CGFloat curXLoc = 0;
	
	for (i = 1; i &lt;= 5; i++)
	{
		// setup each frame to a default height and width, it will be properly placed when we call &quot;updateScrollList&quot;
		CGRect frame = CGRectMake(curXLoc, 0, 768, 1000);
	//	frame.origin = CGPointMake(curXLoc, 0);
		curXLoc += (768);
		//imageView.tag = i;	// tag our images for later use when we place them in serial fashion
		
		UIScrollView *imgScroller = [[UIScrollView alloc] initWithFrame:frame];
		
		//UIImage *image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, i]];

		
		CGRect rectForImage = CGRectMake(0, 0, 768, 1000);
		UIImageView *imageView = [[UIImageView alloc] initWithFrame:rectForImage];
		imageView.tag = i;
	//	[imgScroller]
		
	//	imgScroller.scrollEnabled = YES;
	//	imgScroller.pagingEnabled = YES;
		
		imgScroller.contentSize = CGSizeMake(768, 1000);// rectForImage.size;
		
		[scrollView addSubview:imgScroller];
		
		imgScroller.minimumZoomScale = imgScroller.frame.size.width/imageView.frame.size.width;
		
		imgScroller.maximumZoomScale = 2.0;
		
		
		imgScroller.delegate = self;
		imgScroller.tag = 500+i;
	
		imgScroller.zoomScale = imgScroller.minimumZoomScale;
		NSLog(@&quot;size width: %f&quot;,imgScroller.contentSize.width);
		[imgScroller addSubview:imageView];
				
		[imgScroller release];
		[imageView release];
	}
	
	scrollView.delegate = self;
	scrollView.tag = 10000;
	
	UIScrollView *currentScroller = (UIScrollView *)[scrollView viewWithTag:500+1];
	
	
	UIImageView *currentView = (UIImageView *)[currentScroller viewWithTag:1];
    currentView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, 1]];
	
	[scrollView setContentSize:CGSizeMake(5 * 768, 1000)];
	
}



// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn&#039;t have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren&#039;t in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}

#pragma mark delegate method

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)ascrollView
{
	if(ascrollView.tag !=10000)
	{
		return ascrollView;
	}
	else {
		return nil;
	}

}

- (void)scrollViewWillBeginDragging:(UIScrollView *)ascrollView
{
	if (ascrollView.tag != 10000) {
//		return ;
	}
	
	NSInteger currentPage = (NSInteger)(ascrollView.contentOffset.x/768)+1;
    NSLog(@&quot;Begin : currentPage = %d&quot;,currentPage);
    if (currentPage = 6) {
		UIScrollView *lastScroller = (UIScrollView *)[ascrollView viewWithTag:500+4];
        UIImageView *lastImageView = (UIImageView *)[lastScroller viewWithTag:4];
        lastImageView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, 4]];
        
    } else {
		UIScrollView *lastScroller = (UIScrollView *)[ascrollView viewWithTag:500+currentPage-1];
        UIImageView *lastImageView = (UIImageView *)[lastScroller viewWithTag:currentPage-1];
        NSString *tmpStr = [NSString stringWithFormat:@&quot;002%d.png&quot;,currentPage-1];
       // lastImageView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;%@&quot;, tmpStr]];
		lastImageView.image = [UIImage imageNamed:tmpStr];
		
		
        UIScrollView *nextScroller = (UIScrollView *)[ascrollView viewWithTag:500+currentPage+1];
		UIImageView *nextImageView = (UIImageView *)[nextScroller viewWithTag:currentPage+1];
        NSString *tmpStr1 = [NSString stringWithFormat:@&quot;002%d.png&quot;,currentPage+1];
       // nextImageView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;%@&quot;, tmpStr1]];
		nextImageView.image = [UIImage imageNamed:tmpStr1];
        
    }
}


- (void)scrollViewDidEndDecelerating:(UIScrollView *)ascrollView
{
    NSInteger currentPage = (NSInteger)(ascrollView.contentOffset.x/768)+1;
    NSLog(@&quot;End : currentPage = %d&quot;,currentPage);
    for (NSInteger i = 1; i &lt;= 5; i++) {
        if (i != currentPage) {
			UIScrollView *currentScroller = (UIScrollView *)[ascrollView viewWithTag:500+i];
			
            UIImageView *otherImageView = (UIImageView *)[currentScroller viewWithTag:i];
            otherImageView.image = nil;
        }
    }
	UIScrollView *currentScrollerView = (UIScrollView *)[ascrollView viewWithTag:500+currentPage];
	
    UIImageView *currentView = (UIImageView *)[currentScrollerView viewWithTag:currentPage];
    if (currentView.image == nil) {
  //      NSString *tmpStr = [NSString stringWithFormat:@&quot;fxjyogapic%d.png&quot;,currentPage+1];
        currentView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, currentPage]];
        //currentView.image = [UIImage imageNamed:[NSString stringWithFormat:@&quot;fxjofficeExciresebg%d.png&quot;,currentPage+1]];
    }
}

- (void)scrollViewDidScrollToTop:(UIScrollView *)ascrollView
{
	NSLog(@&quot;Scrolling tag:%d&quot;,ascrollView.tag);
}

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{
	
}


- (void)dealloc {
    [super dealloc];
}

@end</description>
		<content:encoded><![CDATA[<p>请教一个问题，最近在做一个项目。一个类似电子杂志的项目。因为客户需求，如果用pdf做的话怕影响效率。就把pdf转成分辨率较高的图片，一次读取三个，这样画面上最多就加载三个图片。我使用了UIScrollView的嵌套，一个负责缩放，一个负责翻页。现在的问题是，当负责缩放的View的zoomScale放大的时候，划过屏幕相应的第一个事件是翻页，而不是移动当前的画面。请教如何解决。附上代码：//<br />
//  MagazineTestViewController.m<br />
//  MagazineTest<br />
//<br />
//  Created by Cynric on 10-8-20.<br />
//  Copyright __MyCompanyName__ 2010. All rights reserved.<br />
//</p>
<p>#import &#8220;MagazineTestViewController.h&#8221;<br />
#import &#8220;Manager.h&#8221;</p>
<p>@implementation MagazineTestViewController<br />
@synthesize scrollView;</p>
<p>/*<br />
// The designated initializer. Override to perform setup that is required before the view is loaded.<br />
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {<br />
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {<br />
        // Custom initialization<br />
    }<br />
    return self;<br />
}<br />
*/</p>
<p>/*<br />
// Implement loadView to create a view hierarchy programmatically, without using a nib.<br />
- (void)loadView {<br />
}<br />
*/</p>
<p>// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.<br />
- (void)viewDidLoad {<br />
    [super viewDidLoad];</p>
<p>//	scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,768,1024)];</p>
<p>	self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];<br />
	[scrollView setCanCancelContentTouches:NO];<br />
	scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;<br />
	scrollView.clipsToBounds = YES;<br />
	scrollView.scrollEnabled = YES;<br />
	scrollView.pagingEnabled = YES;</p>
<p>		//[self.view addSubview:scrollView];</p>
<p>	NSUInteger i;</p>
<p>	CGFloat curXLoc = 0;</p>
<p>	for (i = 1; i &lt;= 5; i++)<br />
	{<br />
		// setup each frame to a default height and width, it will be properly placed when we call &quot;updateScrollList&quot;<br />
		CGRect frame = CGRectMake(curXLoc, 0, 768, 1000);<br />
	//	frame.origin = CGPointMake(curXLoc, 0);<br />
		curXLoc += (768);<br />
		//imageView.tag = i;	// tag our images for later use when we place them in serial fashion</p>
<p>		UIScrollView *imgScroller = [[UIScrollView alloc] initWithFrame:frame];</p>
<p>		//UIImage *image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, i]];</p>
<p>		CGRect rectForImage = CGRectMake(0, 0, 768, 1000);<br />
		UIImageView *imageView = [[UIImageView alloc] initWithFrame:rectForImage];<br />
		imageView.tag = i;<br />
	//	[imgScroller]</p>
<p>	//	imgScroller.scrollEnabled = YES;<br />
	//	imgScroller.pagingEnabled = YES;</p>
<p>		imgScroller.contentSize = CGSizeMake(768, 1000);// rectForImage.size;</p>
<p>		[scrollView addSubview:imgScroller];</p>
<p>		imgScroller.minimumZoomScale = imgScroller.frame.size.width/imageView.frame.size.width;</p>
<p>		imgScroller.maximumZoomScale = 2.0;</p>
<p>		imgScroller.delegate = self;<br />
		imgScroller.tag = 500+i;</p>
<p>		imgScroller.zoomScale = imgScroller.minimumZoomScale;<br />
		NSLog(@&quot;size width: %f&quot;,imgScroller.contentSize.width);<br />
		[imgScroller addSubview:imageView];</p>
<p>		[imgScroller release];<br />
		[imageView release];<br />
	}</p>
<p>	scrollView.delegate = self;<br />
	scrollView.tag = 10000;</p>
<p>	UIScrollView *currentScroller = (UIScrollView *)[scrollView viewWithTag:500+1];</p>
<p>	UIImageView *currentView = (UIImageView *)[currentScroller viewWithTag:1];<br />
    currentView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, 1]];</p>
<p>	[scrollView setContentSize:CGSizeMake(5 * 768, 1000)];</p>
<p>}</p>
<p>// Override to allow orientations other than the default portrait orientation.<br />
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {<br />
    return YES;<br />
}</p>
<p>- (void)didReceiveMemoryWarning {<br />
	// Releases the view if it doesn&#039;t have a superview.<br />
    [super didReceiveMemoryWarning];</p>
<p>	// Release any cached data, images, etc that aren&#039;t in use.<br />
}</p>
<p>- (void)viewDidUnload {<br />
	// Release any retained subviews of the main view.<br />
	// e.g. self.myOutlet = nil;<br />
}</p>
<p>#pragma mark delegate method</p>
<p>- (UIView *)viewForZoomingInScrollView:(UIScrollView *)ascrollView<br />
{<br />
	if(ascrollView.tag !=10000)<br />
	{<br />
		return ascrollView;<br />
	}<br />
	else {<br />
		return nil;<br />
	}</p>
<p>}</p>
<p>- (void)scrollViewWillBeginDragging:(UIScrollView *)ascrollView<br />
{<br />
	if (ascrollView.tag != 10000) {<br />
//		return ;<br />
	}</p>
<p>	NSInteger currentPage = (NSInteger)(ascrollView.contentOffset.x/768)+1;<br />
    NSLog(@&quot;Begin : currentPage = %d&quot;,currentPage);<br />
    if (currentPage = 6) {<br />
		UIScrollView *lastScroller = (UIScrollView *)[ascrollView viewWithTag:500+4];<br />
        UIImageView *lastImageView = (UIImageView *)[lastScroller viewWithTag:4];<br />
        lastImageView.image = [Manager getImageNoCache:[NSString stringWithFormat:@"002%d.png", 4]];</p>
<p>    } else {<br />
		UIScrollView *lastScroller = (UIScrollView *)[ascrollView viewWithTag:500+currentPage-1];<br />
        UIImageView *lastImageView = (UIImageView *)[lastScroller viewWithTag:currentPage-1];<br />
        NSString *tmpStr = [NSString stringWithFormat:@"002%d.png",currentPage-1];<br />
       // lastImageView.image = [Manager getImageNoCache:[NSString stringWithFormat:@"%@", tmpStr]];<br />
		lastImageView.image = [UIImage imageNamed:tmpStr];</p>
<p>        UIScrollView *nextScroller = (UIScrollView *)[ascrollView viewWithTag:500+currentPage+1];<br />
		UIImageView *nextImageView = (UIImageView *)[nextScroller viewWithTag:currentPage+1];<br />
        NSString *tmpStr1 = [NSString stringWithFormat:@"002%d.png",currentPage+1];<br />
       // nextImageView.image = [Manager getImageNoCache:[NSString stringWithFormat:@"%@", tmpStr1]];<br />
		nextImageView.image = [UIImage imageNamed:tmpStr1];</p>
<p>    }<br />
}</p>
<p>- (void)scrollViewDidEndDecelerating:(UIScrollView *)ascrollView<br />
{<br />
    NSInteger currentPage = (NSInteger)(ascrollView.contentOffset.x/768)+1;<br />
    NSLog(@&#8221;End : currentPage = %d&#8221;,currentPage);<br />
    for (NSInteger i = 1; i &lt;= 5; i++) {<br />
        if (i != currentPage) {<br />
			UIScrollView *currentScroller = (UIScrollView *)[ascrollView viewWithTag:500+i];</p>
<p>            UIImageView *otherImageView = (UIImageView *)[currentScroller viewWithTag:i];<br />
            otherImageView.image = nil;<br />
        }<br />
    }<br />
	UIScrollView *currentScrollerView = (UIScrollView *)[ascrollView viewWithTag:500+currentPage];</p>
<p>    UIImageView *currentView = (UIImageView *)[currentScrollerView viewWithTag:currentPage];<br />
    if (currentView.image == nil) {<br />
  //      NSString *tmpStr = [NSString stringWithFormat:@&quot;fxjyogapic%d.png&quot;,currentPage+1];<br />
        currentView.image = [Manager getImageNoCache:[NSString stringWithFormat:@&quot;002%d.png&quot;, currentPage]];<br />
        //currentView.image = [UIImage imageNamed:[NSString stringWithFormat:@&quot;fxjofficeExciresebg%d.png&quot;,currentPage+1]];<br />
    }<br />
}</p>
<p>- (void)scrollViewDidScrollToTop:(UIScrollView *)ascrollView<br />
{<br />
	NSLog(@&quot;Scrolling tag:%d&quot;,ascrollView.tag);<br />
}</p>
<p>- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale<br />
{</p>
<p>}</p>
<p>- (void)dealloc {<br />
    [super dealloc];<br />
}</p>
<p>@end</p>
]]></content:encoded>
	</item>
	<item>
		<title>admin 关于 答问留言：关于NSOperation 的评论</title>
		<link>http://c.gzl.name/archives/444/comment-page-1#comment-1064</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 07 Jul 2010 22:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=444#comment-1064</guid>
		<description>好像我遇到的情况都是自己写的, bonjour那个是本地通讯, 不过你可以试试一个开源的cocoa amf项目,但是不知道成熟不成熟</description>
		<content:encoded><![CDATA[<p>好像我遇到的情况都是自己写的, bonjour那个是本地通讯, 不过你可以试试一个开源的cocoa amf项目,但是不知道成熟不成熟</p>
]]></content:encoded>
	</item>
	<item>
		<title>Cynric 关于 答问留言：关于NSOperation 的评论</title>
		<link>http://c.gzl.name/archives/444/comment-page-1#comment-1060</link>
		<dc:creator>Cynric</dc:creator>
		<pubDate>Wed, 07 Jul 2010 07:16:53 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=444#comment-1060</guid>
		<description>您好,我是一个iPhone开发的初学者,想请教您个问题.
不知道您是否开发过iPhone网络相关的项目.我想知道一般iPhone是怎么处理网络通讯这方面的.
以前用Flex开发的时候,使用过RO,或者AMF,非常的方便,IPhone不知道您是怎么处理的,可以指教一下嘛?</description>
		<content:encoded><![CDATA[<p>您好,我是一个iPhone开发的初学者,想请教您个问题.<br />
不知道您是否开发过iPhone网络相关的项目.我想知道一般iPhone是怎么处理网络通讯这方面的.<br />
以前用Flex开发的时候,使用过RO,或者AMF,非常的方便,IPhone不知道您是怎么处理的,可以指教一下嘛?</p>
]]></content:encoded>
	</item>
	<item>
		<title>happyfrank 关于 数据类型/对象类型介绍（1）NSString 的评论</title>
		<link>http://c.gzl.name/archives/324/comment-page-1#comment-1054</link>
		<dc:creator>happyfrank</dc:creator>
		<pubDate>Tue, 06 Jul 2010 16:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=324#comment-1054</guid>
		<description>爱死你了   ，，，，

接着 努力    向你 看齐 ！！</description>
		<content:encoded><![CDATA[<p>爱死你了   ，，，，</p>
<p>接着 努力    向你 看齐 ！！</p>
]]></content:encoded>
	</item>
	<item>
		<title>jin 关于 实例：iPhone随机数生成器 的评论</title>
		<link>http://c.gzl.name/archives/268/comment-page-1#comment-1052</link>
		<dc:creator>jin</dc:creator>
		<pubDate>Tue, 06 Jul 2010 09:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=268#comment-1052</guid>
		<description>下载实例，说是 谢谢！</description>
		<content:encoded><![CDATA[<p>下载实例，说是 谢谢！</p>
]]></content:encoded>
	</item>
	<item>
		<title>admin 关于 Mac:打开一个目录 的评论</title>
		<link>http://c.gzl.name/archives/564/comment-page-1#comment-1049</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 06 Jul 2010 04:15:02 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=564#comment-1049</guid>
		<description>嗯,在这边,你小子调查户口么?

没太理解你的思路... 不过

想ls,试试nsfilemanager就可以了, 我就在这个帖子后面的帖子里面有用,不过没尝试过在iphone上用.你可以尝试一下,可能会不好使, 因为iphone的沙箱设计, 试试吧</description>
		<content:encoded><![CDATA[<p>嗯,在这边,你小子调查户口么?</p>
<p>没太理解你的思路&#8230; 不过</p>
<p>想ls,试试nsfilemanager就可以了, 我就在这个帖子后面的帖子里面有用,不过没尝试过在iphone上用.你可以尝试一下,可能会不好使, 因为iphone的沙箱设计, 试试吧</p>
]]></content:encoded>
	</item>
	<item>
		<title>zykhbl 关于 Mac:打开一个目录 的评论</title>
		<link>http://c.gzl.name/archives/564/comment-page-1#comment-1047</link>
		<dc:creator>zykhbl</dc:creator>
		<pubDate>Tue, 06 Jul 2010 01:54:18 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=564#comment-1047</guid>
		<description>大哥，你博客的评论回复时间比我这边的晚了大概16个小时，服务器是不是部署在美国西部啊，还是你现在就在那边，呵呵：），算是私人问题了，不好意思..</description>
		<content:encoded><![CDATA[<p>大哥，你博客的评论回复时间比我这边的晚了大概16个小时，服务器是不是部署在美国西部啊，还是你现在就在那边，呵呵：），算是私人问题了，不好意思..</p>
]]></content:encoded>
	</item>
	<item>
		<title>zykhbl 关于 Mac:打开一个目录 的评论</title>
		<link>http://c.gzl.name/archives/564/comment-page-1#comment-1046</link>
		<dc:creator>zykhbl</dc:creator>
		<pubDate>Tue, 06 Jul 2010 01:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=564#comment-1046</guid>
		<description>恩，那你这样子还是写死了所有的文件路径，只不过是写到文件里，我捏，是想做一个支持网盘协议的上传下载的客户端，或者支持ftp协议的，这样子的话都需要在点上传下载按钮时弹出整个iphone（如果是电脑的话就是硬盘的了，像NSOpenPanel那样的）的文件目录，让用户自动选择路径，其实不是直接打开/关闭文件，最终上传下载时也是要读到文件流里
其实在c语言里不是有    
        char *path=[NSHomeDirectory() UTF8String];//起始目录为Home,转为c的字符串
        DIR *dp;
	struct dirent *dirp;
	
	if ((dp = opendir(path)) == NULL) {
		err_sys(&quot;can`t open %s&quot;, path);
	}
	
	while ((dirp = readdir(dp)) != NULL) {
		printf(&quot;%s\n&quot;, dirp-&gt;d_name);
//打印出当前目录下的所有文件或文件夹，如果时文件夹的话，用户点一下，就把文件夹的路径作为当前的path，以后//的显示操作又是这样
	}
	
	closedir(dp);


PS:不知道这样行不行的通，上面那段代码是相当于unix的命令ls，我不了解iphone的文件目录结构，不知道行不行？</description>
		<content:encoded><![CDATA[<p>恩，那你这样子还是写死了所有的文件路径，只不过是写到文件里，我捏，是想做一个支持网盘协议的上传下载的客户端，或者支持ftp协议的，这样子的话都需要在点上传下载按钮时弹出整个iphone（如果是电脑的话就是硬盘的了，像NSOpenPanel那样的）的文件目录，让用户自动选择路径，其实不是直接打开/关闭文件，最终上传下载时也是要读到文件流里<br />
其实在c语言里不是有<br />
        char *path=[NSHomeDirectory() UTF8String];//起始目录为Home,转为c的字符串<br />
        DIR *dp;<br />
	struct dirent *dirp;</p>
<p>	if ((dp = opendir(path)) == NULL) {<br />
		err_sys(&#8220;can`t open %s&#8221;, path);<br />
	}</p>
<p>	while ((dirp = readdir(dp)) != NULL) {<br />
		printf(&#8220;%s\n&#8221;, dirp-&gt;d_name);<br />
//打印出当前目录下的所有文件或文件夹，如果时文件夹的话，用户点一下，就把文件夹的路径作为当前的path，以后//的显示操作又是这样<br />
	}</p>
<p>	closedir(dp);</p>
<p>PS:不知道这样行不行的通，上面那段代码是相当于unix的命令ls，我不了解iphone的文件目录结构，不知道行不行？</p>
]]></content:encoded>
	</item>
	<item>
		<title>admin 关于 Mac:打开一个目录 的评论</title>
		<link>http://c.gzl.name/archives/564/comment-page-1#comment-1044</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 05 Jul 2010 16:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=564#comment-1044</guid>
		<description>iphone不能直接打开/关闭文件, 所以没有...

不过你可以自己写阿~~ 
如果只是string文件, 那也不过是[NSString stringWithContentsOfFile:&lt;#(NSString *)path#&gt; encoding:&lt;#(NSStringEncoding)enc#&gt; error:&lt;#(NSError **)error#&gt;]. 
如果是raw data, 就是[NSData dataWithContentsOfFile:&lt;#(NSString *)path#&gt; options:&lt;#(NSDataReadingOptions)readOptionsMask#&gt; error:&lt;#(NSError **)errorPtr#&gt;]</description>
		<content:encoded><![CDATA[<p>iphone不能直接打开/关闭文件, 所以没有&#8230;</p>
<p>不过你可以自己写阿~~<br />
如果只是string文件, 那也不过是[NSString stringWithContentsOfFile:< #(NSString *)path#> encoding:< #(NSStringEncoding)enc#> error:< #(NSError **)error#>].<br />
如果是raw data, 就是[NSData dataWithContentsOfFile:< #(NSString *)path#> options:< #(NSDataReadingOptions)readOptionsMask#> error:< #(NSError **)errorPtr#>]</p>
]]></content:encoded>
	</item>
	<item>
		<title>zykhbl 关于 Mac:打开一个目录 的评论</title>
		<link>http://c.gzl.name/archives/564/comment-page-1#comment-1039</link>
		<dc:creator>zykhbl</dc:creator>
		<pubDate>Mon, 05 Jul 2010 09:09:58 +0000</pubDate>
		<guid isPermaLink="false">http://c.gzl.name/?p=564#comment-1039</guid>
		<description>我想问一下，iphone有没有这种弹窗</description>
		<content:encoded><![CDATA[<p>我想问一下，iphone有没有这种弹窗</p>
]]></content:encoded>
	</item>
</channel>
</rss>
