Recently in iPhone Category

@金色

| No Comments | No TrackBacks
kong_hometown.JPG
@yarshure 2011.09.19 下午  

WWDC归来

| No Comments | No TrackBacks
今年的WWDC 已经闭幕一个半月,回到上海已经一个月有于,总想写点什么,单不知从何写起。

WWDC 不只是技术会议,其实是技术人员的集会。如果你活跃在twitter和其他圈子,你可能会见到很多线上的朋友。这次我遇到了来自 加拿大独立开发者 @Anxonli ,来自国内上海的 独立开发者 @backspacer ,阿里系的开发者 @nowazhu ,来自AutoDesk的老朋友 @snakeeyxp。
还有很多朋友,如果不是因为WWDC,可能我们几乎没有见面的机会。

另外,WWDC期间我们认识第一财经周刊的记者,竟然不是哪的记者badge,而是以开发者身份参加,着实让我吃惊。
下面是这位记者的文章,估计很多人已经读过。

WWDC前期还遇到曾经给我回复过邮件的DTS Engineer。

原本打算在伯克利大学好好逛逛,无奈天公不做美,去的那天一直下雨。希望....

今年排队看乔布斯的人很多,下面是我拍摄的视频。

部分人还是买高价票去的,除了正常购买外,预留门票数量有限。

WWDC会议重要的不是session, 而是在Lab, 在Lab里面你可以拿你的代码去问苹果的工程师,一两句指点可能对你的产品有很大的帮助。

回来后同事和我聊天,说:"可以下载到Session视频,明年可以不用去了。" 也是许吧,毕竟整个行程费用不低。

写点攻略
1 旧金山的6月晚上还是毕竟凉,街上偶尔能看到穿棉衣的,如果去的时候没有准备,尽量还是买件厚点的衣服。
2 从机场到旧金山市区还是比较方便,如果没有出游计划不租车的话可以坐Burt
3 渔人码头39号Crab House Double shimp Double crab双虾双蟹 http://instagr.am/p/FawgA/
   一定要品尝,价格也不贵。
4 排队早晚去关系不是很大,攻略是进主会场后要蹲守在VIP区域附近。VIP区域可能是坐不满,机会很大,开场前会放一小部分观众过去。
5 会场提供早餐和午餐,基本一天都可以在会场里面。
6 如果购物,去Gilroy不错,在San Jose 南,沿着101开车即可到达。
7 斯坦福大学一定要去,今年看到很多系在搞毕业典礼。


先写这么多,照片拍了几十GB,还没有空整理,部分照片发到Flickr,地址 

Enhanced by Zemanta
介绍
Advanced iPhone Development - Fall 2010

While there are many resources out there to help you get started in developing for iPhone OS devices, this course aims to answer the question: "What next?"  Fundamentals of Cocoa development are explained, but the class quickly moves on to coverage of the many interesting frameworks within iPhone OS.  Topics such as Core Animation, Core Data, OpenGL ES, multithreading, and iPad-specific development are presented from the perspective of an experienced Cocoa developer.


This course is offered by the Madison Area Technical College's Information Technology Department and is a once-a-week professional development class.  Course videos are made available in 720p HD upon the completion of the semester, and the detailed course notes (in VoodooPad format) can also be downloaded from the iTunes U class page.  Links to all sample applications used for the course can be found in the notes.


Prerequisites: Completion of iPhone Apps Development or previous experience with developing for the iPhone OS platform.
Dr. Brad Larson 主讲
屏幕快照 2010-11-29 下午01.04.40.png的缩略图

课程内容
1. Introduction : Design of iOS applications.mp4
2. Understanding Cocoa : Targeting multiple OS versions and devices.mp4
3. Testing.mp4
4. Views and view controllers.mp4
5. Quartz 2D.mp4
6. Core Animation.mp4
7. Core Data.mp4
8. Touches, scroll views, and the accelerometer.mp4
9. Networking.mp4
10. Camera, audio, and video.mp4
11. Performance tuning.mp4
12. Multithreading, multitasking, and GCD.mp4
13.OpenGL ES 20.mp4


UIViewAnimation with block

| No Comments | No TrackBacks

UIViewAnimationWithBlocks使用block,动画结束后不需要使用回调方法,相比UIViewAnimation 方式要简洁很多


- (void)setSelectedVeg:(id)sender

{    

    [selectedVegetableIcon setAlpha:0.0];

    

    [UIView animateWithDuration:0.4

                     animations: ^{

                         float angle = [self spinnerAngleForVegetable:sender];

                         [vegetableSpinner setTransform:CGAffineTransformMakeRotation(angle)];

                     } 

                     completion:^(BOOL finished) {

                         [selectedVegetableIcon setAlpha:1.0];

                     }];


}

以上代码来自WWDC2010 iPlant PlantCareViem.m


UIViewAnimation style Animation

- (void)setSelectedVeg:(id)sender

{    

    [selectedVegetableIcon setAlpha:0.0];

[UIView beginAnimations:@"setSelectedVeg" context:nil];

float angle = [self spinnerAngleForVegetable:sender];

[vegetableSpinner setTransform:CGAffineTransformMakeRotation(angle)];

[UIView setAnimationDuration:0.4];

[UIView setAnimationDelegate:self];

[UIView setAnimationDidStopSelector:@selector(done)];

[UIView commitAnimations];

}

-(void)done

{

[selectedVegetableIcon setAlpha:1.0];

}

NSOperation and KVO/KVC coding

| No Comments | No TrackBacks

本文简要介绍如何使用KVO 跟踪NSOperation 状态


traceOperation 方法跟踪 PageLoadOperation(NSOperation 子类)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    

    // Override point for customization after app launch 

for (NSString *urlString in urlArray

{

        NSURL *url = [NSURL URLWithString:urlString];

        PageLoadOperation *plo = [[PageLoadOperation alloc] initWithURL:url];

        [queue addOperation:plo];

[self traceOperation:plo];

        [plo release];

    }

    [window addSubview:viewController.view];

    [window makeKeyAndVisible];

return YES;

}

traceOperation 方法

KeyPath 官方文档说明 http://developer.apple.com/mac/library/documentation/cocoa/reference/NSOperation_class/Reference/Reference.html#//apple_ref/doc/c_ref/NSOperation

KVO-Compliant Properties

The NSOperation class is key-value coding (KVC) and key-value observing (KVO) compliant for several of its properties. As needed, you can observe these properties to control other parts of your application. The properties you can observe include the following:

  • isCancelled - read-only property

  • isConcurrent - read-only property

  • isExecuting - read-only property

  • isFinished - read-only property

  • isReady - read-only property

  • dependencies - read-only property

  • queuePriority - readable and writable property

  • completionBlock - readable and writable property (Mac OS X only)

-(void)traceOperation:(NSOperation*)obj

{

[obj addObserver:self

  forKeyPath:@"isExecuting"

  options:0

  context:NULL];

[obj addObserver:self

  forKeyPath:@"isFinished"

  options:0

  context:NULL];

[obj addObserver:self

  forKeyPath:@"isReady"

options:0

context:NULL];

[obj addObserver:self

  forKeyPath:@"isCancelled"

options:0

context:NULL];

}


loadNibNamed 的使用

| No Comments | No TrackBacks
感觉很怪怪的

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

    static NSString *CellIdentifier = @"ApplicationCell";

    

    ApplicationCell *cell = (ApplicationCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {

#if USE_INDIVIDUAL_SUBVIEWS_CELL

        [[NSBundle mainBundle] loadNibNamed:@"IndividualSubviewsBasedApplicationCell" owner:self options:nil];

        cell = tmpCell;

        self.tmpCell = nil;

#elif USE_COMPOSITE_SUBVIEW_CELL

        cell = [[[CompositeSubviewBasedApplicationCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ApplicationCell"] autorelease];

#elif USE_HYBRID_CELL

        cell = [[[HybridSubviewBasedApplicationCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ApplicationCell"] autorelease];

#endif

    }

    

// Display dark and light background in alternate rows -- see tableView:willDisplayCell:forRowAtIndexPath:.

    cell.useDarkBackground = (indexPath.row % 2 == 0);


// Configure the data for the cell.

    NSDictionary *dataItem = [data objectAtIndex:indexPath.row];

    cell.icon = [UIImage imageNamed:[dataItem objectForKey:@"Icon"]];

    cell.publisher = [dataItem objectForKey:@"Publisher"];

    cell.name = [dataItem objectForKey:@"Name"];

    cell.numRatings = [[dataItem objectForKey:@"NumRatings"] intValue];

    cell.rating = [[dataItem objectForKey:@"Rating"] floatValue];

    cell.price = [dataItem objectForKey:@"Price"];


    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;


    return cell;

}

iphone ipsw total list

| No Comments | No TrackBacks
[yarshure@yarshures-MacBook-Pro]%curl http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.appserver.client.MZITunesClientCheck/version | grep ipsw | grep -i iphone| sed 's/^[[:space:]]*//g' | sed 's/<string>//g' | sed 's/<\/string>//g'|uniq

http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7473.20100202.4i44t/iPod3,1_3.1.3_7E18_Restore.ipsw

http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7481.20100202.4orot/iPhone1,1_3.1.3_7E18_Restore.ipsw
http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7468.20100202.pbnrt/iPhone1,2_3.1.3_7E18_Restore.ipsw
http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7472.20100202.8tugj/iPhone2,1_3.1.3_7E18_Restore.ipsw

Quartz 2D 基础

| No Comments | No TrackBacks
CGImageCreateWithImageInRect 使用

如何画矩形

CGRect backRect = CGRectMake(1010508);

CGContextSetRGBFillColor(context, 1.01.01.01.0);

CGContextFillRect(context, backRect);


下面的代码是选择坐标系

CGContextTranslateCTM(context, 0.0self.frame.size.height);

CGContextScaleCTM(context, 1.0, -1.0);

CGContextShowTextAtPoint 不能draw中文,中文等UTF8 需要用

NSString drawAtPoint 这个方法

看看效果
屏幕快照 2009-12-09 上午02.48.31.png

日期:  11 月8日 下午2:00
地址:上海 长宁 万航渡路2453号 周家桥创意园B区
内容: iPhone 应用&游戏开发
       主题演讲1 游戏中使用OpenAL
dream2
上海骏梦网络科技有限公司 http://www.thedream.cc/ 
联系人:孔祥波  yarshure@gmail.com
dryiceboy_092758170721904.jpg 屏幕快照 2009-10-02 上午12.26.28.png