Posts Tagged ‘iPhone’

21
Mar

iPad 开发初探

   Posted by: 边城浪子    in Apple & Mac, iPhone & iPad

因为 Apple 宣布开始接受 iPad App 的 Review,而且要赶在 27 号之前,所以我着急忙慌的将之前的 iPhone App 做一下改装。本来没想这么快就开发 iPad App,所以只能借助官方的 iPad Programming Guide 来进入。

之前在小屏幕上,不断的切换 UIView,倒是很方便的,而且内存泄露也很好查。现在这些 PopoverController、RootViewController、DetailViewController 以及 SplitViewController 混在一起,之前跑得好好的代码又出现了轻微的泄露,害得改了半天。

开发 iPad App,如果不常使用 delegate 的话,就会比较麻烦了。比如你要写 PopoverView,那么如果不通过 delegate(或者用 notification,不过没必要),那么就会费很大的劲儿。感觉上,现在 iPad App 更像是在开发一个真正意义上的应用了。

在我的第一个 iPad 应用中,除了 SplitView 自己有一个 Popover 以外,我自己还有一个 Popover,当用户按下上面的按钮的时候,需要关闭 Popover 并且将更改的数据传回主程序,同时刷新 RootViewController 里面的 tableView。以前我直接将数据传给一个 UIView,然后再 Push 它就可以了,现在则需要用 delegate。下面是核心的代码,其实很简单喽:

#pragma mark -
#pragma mark 选择代理
-(IBAction)dateSelectorButtonPushed:(id)sender {
 
	// 获取 target
	DateViewController *parent = (DateViewController *)sender;
 
	// 重新读取数据
	RootViewController *rootViewController = 
	     (RootViewController *)[[[UIApplication sharedApplication] delegate]
			     rootViewController];
	[rootViewController setDateMonth:parent.monthNow Day:parent.dayNow];	
	[rootViewController readContent];
 
	// Dismiss
	[self.popoverController dismissPopoverAnimated:YES];
	self.popoverController = nil;	
}

总的来说,移植还是满快的,我已经提交到 iTunes Connection 去了,上传界面多了 iPad 的截图文件上传,其它倒也没看见什么大变化。现在 Waiting For Review 了。

Tags: , , , , , ,

25
Feb

自定义的 UITableCellView 需要注意的一个地方

   Posted by: 边城浪子    in iPhone & iPad

我在不少 iPhone 程序里面使用自定义的 UITableCellView,比如之前的 80’s Movie Quotes,tableView 表现得很流畅,但是在最近一个项目中,却出现了奇怪的现象。

我自定义了一个 UITableCellView,然后在代码中引用:

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView
    cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"MainCell";
 
    MainCellViewController *cell = (MainCellViewController *)
        [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
	NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MainCellView"
                                                     owner:self
                                                   options:nil];
	cell = [nib objectAtIndex:0];
    }
 
    // Set up the cell...
    cell.titleLabel.text = [[content objectAtIndex:indexPath.row] title];
 
    return cell;
}

一切看起来正常,但是在滚动 tableView 的时候,却发现有很卡的感觉,开始以为是我的 Custom UITableCellView 用了太多透明的 png,后来发现不是这样。经过检查,发现问题出在 CellIdentifier 上。

我之前一直以为 CellIdentifier 只要能区分要重复使用的 UITableCellView 就可以了,在使用默认的 tableView 的时候确实表现如此,但是用在自定义 UITableCellView 的时候就不是这样了,感觉是元件没有被缓存,每次都要重新初始化似的。

后来,我为 UITableCellView 在 IB 里面指定了 Identifier,我的 tableView 滚动马上变得平滑了。

Identifier

这个定义应该可以在代码中实现,不过在 IB 中定义一下还是很方便的。

这个其实很简单,之所以记录一下,是要提醒自己,不能什么都想当然了。

Tags: , , , , , , , ,

6
Jan

Adobe iPhone 上面要发威

   Posted by: 边城浪子    in Apple & Mac, Flash 相关

今天收到 CS5 Beta 测试的例行邮件,又有新的消息出来。新消息无疑会极大程度上激励开发者,比如我,就琢磨着把之前搁置的一个小项目拿起来。

由于 NDA 的缘故,不能说什么了,不过,相信很快大家就会在 AppStore 中看到更多的 Flash 作品了。

Tags: , , , ,

2
Dec

参加了 WWDRChina

   Posted by: 边城浪子    in iPhone & iPad

Apple 真是,上来最先就说,活动都是基于已经签署的 NDA 协议的,所以,不能拍照、不能摄像也不能写 Blog。我有阵子没有用推,不晓得有人在推上发了什么没有。

认识了一个老外,聊了一会儿,回来加了他的 Linked In,顺便也把“骨头”的名片给了他,或许他们以后有机会合作吧?

我该准备一些关于某个软件的内容了,那是另外一个 NDA,也不能乱说,不过我可以先写了⋯⋯

Tags: , ,

转帖的,但是此消息比较震惊啊!

Earlier today, Adobe revealed Flash Player 10.1 for smartphones, the company’s fastest and most efficient form of flash for mobile phones yet. Android, Symbian, Windows Mobile, webOS, BlackBerry…all of these phones will support Flash Player 10.1 by mid-2010. But the iPhone was nowhere to be found.

The problem: Adobe and Apple have been playing a painful game that has resulted in a lack of Flash support for red-hot smartphone. Apple doesn’t seem enthusiastic about adding Flash support, Adobe isn’t pushing hard enough. But at the Adobe MAX Conference, the rich Internet application software company announced support for Flash. Sort of.

It’s actually a new addition to Adobe Flash Professional CS5. Adobe has added the ability for Flash developers to export their work into iPhone app format, without the need to rebuild the entire app from scratch. You could soon see your favorite Flash games and web apps in the iTunes App Store.

The announcement is a great one for developers who have had to rebuild code to make their apps iPhone-friendly. However, this does nothing to place Flash inside the iPhone Safari browser. Until this happens, we won’t be satisfied. Flash is a core component of the web. Hopefully Apple realizes this sometime soon.

From:http://mashable.com/2009/10/05/iphone-flash/

Tags: , , , , ,

17
Feb

[转] Adobe Flash 将很快登陆多款智能手机

   Posted by: 边城浪子    in Flash 相关, 关注技术

完全版 Adobe Flash 将很快登陆多款智能手机,但令人遗憾的是,其中不包括苹果的 iPhone。

Adobe 周一在 Mobile World Congress 大会上宣布,Flash Player 10 将能够在运行 Windows Mobile、Google 的 Android、诺基亚的 S60/Symbian 和 Palm 的 Web OS 操作系统的智能手机上运行。

支持 Flash Player 10 的手机将于 2010 年初上市销售。

多年来,Adobe 一直在开发能够在手机上运行的瘦身版Flash技术——Flash Lite。该公司高管称,目前,约40%的手机使用了 Flash Lite。但由于 Flash Lite 功能不同于桌面版,因此没有受到手机用户青睐。Adobe 首席技术官凯文·林奇去年 11 月表示,该公司将把完全版 Flash 移植到智能手机上。

尽管Flash 10将于明年初登陆大多数智能手机,但其中却不包括 iPhone。Adobe 高管表示,Flash 10 将会支持 iPhone。Adobe 负责技术战略和合作伙伴业务的主管阿努普·穆拉卡说:“我们希望 Flash 10 能够在 iPhone 上运行,但决定 iPhone 支持新技术时间和方式的是苹果。”

Adobe CEO 山塔努·纳拉延本月早些时候在达沃斯世界经济论坛期间表示,该公司在开发 iPhone 版 Flash 技术时遇到了技术困难,但表示将与苹果继续合作开发 iPhone 版 Flash 。

Tags: , , , ,

我必须要转,尤其是结尾部分,太精彩袅!

视频请进入观看: Read the rest of this entry »

Tags: ,

10
Jan

iPhone !!!

   Posted by: 边城浪子    in Apple & Mac

iPhone如果说有什么东西是真正“千呼万唤始出来”的话,我想在今年,能够被这么称呼的东西只有 Apple 的 iPhone 了,M$ 的 Vista 注定仍旧是个垃圾。在今天的 Macworld2007 上,乔布斯向大家发布了 iPhone。

用 Keynote 上的一句话来介绍的话,就是:“苹果重新发明了电话”:iPod + Phone + Internet。Multi-Touch 技术使得用户可以不用触控笔,在屏幕上进行快速的输入,3.5 吋屏幕,高解析 320 by 480 at 160 ppi,115 x 61 x 11.6mm,135 grams,GSM,200 万像素相机,WiFi(802.11b/g) + EDGE + Bluetooth 2.0,手机屏幕上只有 Home 这一个按键,--苹果的简约是大家所熟悉的。内建 4 到 8 G 内存,而且令人惊讶的是:运行在 OS X 上!还有 Safari 浏览器--这简直就是传说中的梦幻手机!但是却是真实的从乔布斯口中发布出来! Read the rest of this entry »

Tags: , ,