- 博客(35)
- 资源 (3)
- 收藏
- 关注
原创 initWithFrame:reuseIdentifier:
initWithFrame:reuseIdentifier:Initializes and returns a table-view cell object.- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifierParametersframeThe frame rectang
2009-04-27 16:13:00 2251
原创 dequeueReusableCellWithIdentifier
dequeueReusableCellWithIdentifier:Returns a reusable table-view cell object located by its identifier.- (UITableViewCell *)dequeueReusableCellWithIdentifier:(NSString *)identifierParametersi
2009-04-27 16:04:00 2645
原创 委托的实现代码
#include using namespace std;templateclass A{ private: typedef int (T::*delegateFun)(int); T * _This; delegateFun _deleGate; public: //This±»´úÀíµÄ¶ÔÏó, delegateFun±»´úÀíµÄ·½·¨
2009-04-27 10:19:00 790
原创 new
newAllocates a new instance of the receiving class, sends it an init message, and returns the initialized object.+ (id)newReturn ValueA new instance of the receiver.DiscussionThis method i
2009-04-25 17:31:00 491
原创 imageNamed
imageNamed:Returns the image object associated with the specified filename.+ (UIImage *)imageNamed:(NSString *)nameParametersnameThe name of the file, including its filename extension. If
2009-04-25 17:16:00 563
原创 loadView Problem..
loadView Problem.. HI all.In my iPhone App, am adding a subView(button , image view etc) to the view of a viewController in its loadView method...But the program is going in a infinit
2009-04-17 13:16:00 760
原创 loadView
loadViewCreates the view that the controller manages.- (void)loadViewDiscussionThis method is only invoked when the view property is nil and it is needed for display. You should not invoke t
2009-04-17 13:10:00 559
原创 iphone通话记录表
修改iphone通话记录100条的限制(也可清除通话时间记录)iphone电话记录有100条的上限,考虑到部分人的需要,公布修改方法如下:1. 用ibrickr下载call_history.db数据库到本机,在:/paivate/var/root/Library/CallHistory/目录下面 2. 下载Sqlite数据库,很小的程序。 3. 在命令行下输入"sqlite calLh
2009-04-17 11:33:00 7276
原创 applicationDidFinishLaunching
applicationDidFinishLaunching:Tells the delegate when the application has finished launching. This method is optional.- (void)applicationDidFinishLaunching:(UIApplication *)applicationParamete
2009-04-16 13:26:00 7713
原创 applicationWillTerminate
applicationWillTerminate:Tells the delegate when the application is about to terminate. This method is optional.- (void)applicationWillTerminate:(UIApplication *)applicationParametersapplica
2009-04-16 13:23:00 3018
原创 去掉回退时被选种的行
NSIndexPath *tableSelection = [myTableView indexPathForSelectedRow]; [myTableView deselectRowAtIndexPath:tableSelection animated:NO];
2009-04-15 19:40:00 818
原创 为UITabelViewController 加入 UINavigationController
1. UIBarButtonItem *barBuItem = [ [ UIBarButtonItem alloc ] initWithTitle:@"left" style:UIBarButtonItemStyleDone target: self action:nil ]; UIBarButtonItem *barRightItem = [ [ UI
2009-04-15 14:08:00 2116 2
原创 initWithRootViewController
initWithRootViewController:Initializes and returns a newly created navigation controller.- (id)initWithRootViewController:(UIViewController *)rootViewControllerParametersrootViewControllerTh
2009-04-14 12:00:00 6291
原创 iphone 如何发送短信
http://code.google.com/p/iphone-sms/source/browse/trunk/?r=2#trunk%3Fstate%3Dclosed
2009-04-14 10:54:00 1043
原创 cocoa 开发总结
1.对iphone 中得tableview非常熟悉 ,灵活的运用tableview得属性,能充分发挥其 功能,在熊猫播放器的播放列表能够灵活运。在iphone sdk 中的的delegate 属性,能够让用户方便的传递消息,非常的灵活。用得得当,能够优化代码,否则就使代码僵硬,不容易扩展维护。同时iphone理由NSuserdault这个类,就相当于数据库,能够方便得保存数据,用户
2009-04-14 10:29:00 1804 1
原创 UITableView的多选
关于UITableView的多选 UITableView只要界面有重新刷新都会触发- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath 这个函数。当选中TableView中的某一行时,触发该函数:- (void)tableViewUITableVie
2009-04-14 10:15:00 3581 2
原创 两种 iPhone 界面的动画效果
两种 iPhone 界面的动画效果 实现漂亮的动画效果,iPhone SDK 提供了很简单的接口。1 - 翻页效果:[UIView beginAnimations:nil context:NULL];[UIView setAnimationDuration:URATION_TIME];[UIView setAnimationTransition:UIViewAnimationTransitio
2009-04-14 09:55:00 3252 1
原创 不用ID实现一个事件通过多个观察者
观察者模式在symbian里用得很多,都是用来回调的。很多情况下一个事件发生后,需要通知多个观察者,比如timer触发后,要对所有的观察者通知,这个怎么实现?方法当然很简单,把M类写成如下形式就可以了:MTimerNotify {void Notify() = 0;TInt& ID() = 0;};这样,每个观察者对应一个ID,实现通知就很简单了。但是有没有方法实现M类里只有回调没有ID函数呢。答
2009-04-13 20:21:00 872
原创 makeKeyAndVisible
makeKeyAndVisibleMakes the receiver the key window and makes that window visible.- (void)makeKeyAndVisibleDiscussionThis is a convenience method to make the receiver the main window and displ
2009-04-13 15:15:00 5046
原创 drawRect introduce
drawRect:Draws the receiver’s image within the passed-in rectangle.- (void)drawRect:(CGRect)rectParametersrectA rectangle defining the area to restrict drawing to.DiscussionSubclasses override this me
2009-04-13 15:03:00 1053
原创 UIScreen 获取iphone屏幕宽度
CGRect r = [ UIScreen mainScreen ].applicationFrame;r=0,20,320,460 CGRect rx = [ UIScreen mainScreen ].bounds;r=0,0,320,480
2009-04-09 20:01:00 6864
原创 UITableViewController 要注意的地方
-(void)loadView{ UIView *contentView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; self.view = contentView; [contentView release]; UITableView *tableView = [ [ UITableView
2009-04-09 19:21:00 1551 1
原创 Cocoa 框架
Cocoa 框架接下来的段落总结了 Cocoa 的类和一些重要的框架的示意图,特别是核心框架 Foundation (基础)和 Application Kit (应用程序工具箱)。内容: 介绍 基础框架 应用程序工具箱 其它 Cocoa API 框架 介绍是什么使得一个程序变成了一个 Cocoa 的程序?它其实不是编程语言,因为您可以在 Cocoa
2009-04-08 21:38:00 5526 2
原创 设计模式精解之——Prototype模式
0 引言0.1 目的 本文档给出设计模式之——Prototype模式的简化诠释,并给出其C++实现。0.2 说明ProjectDesign Pattern Explanation(By K_Eckel)AuthorizationFree Distributed but Ownership Reser
2009-04-08 13:26:00 1033
原创 如何在一个已排序的NSArray中搜索某一特定字符串?答案是使用CFArray自带的搜索功能:
如何在一个已排序的NSArray中搜索某一特定字符串?答案是使用CFArray自带的搜索功能: NSMutableArray *sortedArray = [NSMutableArray arrayWithObjects: @"Alice", @"Beth", @"Carol",@"Ellen",nil]; //Where is "Beth"?unsigned inde
2009-04-07 20:05:00 1912
原创 委托例子代码
#include "stdio.h"class CObject{};class Event{ public: unsigned long EventType; public: Event(unsigned long EventType) { this->EventType = EventType; }};class Handler{ publi
2009-04-07 19:28:00 646
原创 HelloWin Demo with codes
这次主要讲解一下如何通过编写代码的方式来实现一个窗口程序, 当然这个程序十分的简单, 不过它演示了一些我们应该了解的东西,因此应该可以更好的帮助我们了解XCode和Interface builder为我们的开发工作做了哪些工作。 大部分讲解Cocoa编程的书都会用到Xcode和interface builder,这两个工具的结合是开发Cocoa应用程序的最佳选择, 但是当中往往隐藏了许多细节的东
2009-04-07 10:15:00 582
原创 Cocoa简单获取系统地址簿联系人的方法
新版本的Skype和一些其他聊天工具都提供了自动将地址簿联系人加入联系人列表的功能,本文通过例子简单地介绍如何使用Cocoa获取Mac OS X的地址簿中联系人的各种信息,这样你也可以在自己的程序中导入系统的地址簿中联系人的各种信息了。 获取联系人信息的大致例子如下: #import 如果在程序中使用地址簿,需要引用AddressBook/AddressBook.hABA
2009-04-05 21:08:00 1089
原创 委托、信号和消息反馈的模板实现技术
委托、信号和消息反馈的模板实现技术作者:落木随风提交者:eastvc 发布日期:2003-9-20 10:25:27原文出处:http://www.cpphelp.net/issue/delegation.html憋了很长一段时间的想法,在这里说说,希望听听诸位高手的意见。我写过不少C++程序(当然比起高手还是差远了),写过库也写过客户程序。一般库都会提供一些好用的类供客户程序使用,不少
2009-04-05 21:06:00 911
原创 Dynamic loading
Dynamic loading is a mechanism by which a computer program can, at runtime, load a library (or other binary) into memory, retrieve the addresses of functions and variables contained in the library,
2009-04-05 20:58:00 1337
原创 声明函数指针并实现回调
程序员常常需要实现回调。本文将讨论函数指针的基本原则并说明如何使用函数指针实现回调。注意这里针对的是普通的函数,不包括完全依赖于不同语法和语义规则的类成员函数(类成员指针将在另文中讨论)。声明函数指针 回调函数是一个程序员不能显式调用的函数;通过将回调函数的地址传给调用者从而实现调用。要实现回调,必须首先定义函数指针。尽管定义的语法有点不可思议,但如果你熟悉函数声明的一般方法,便会发现
2009-04-02 14:00:00 969
原创 C#委托之个人理解
什么是委托 首先要知道什么是委托,用最通俗易懂的话来讲,你就可以把委托看成是用来执行方法(函数)的一个东西。如何使用委托 在使用委托的时候,你可以像对待一个类一样对待它。即先声明,再实例化。只是有点不同,类在实例化之后叫对象或实例,但委托在实例化后仍叫委托。声明,如:1 namespace Vczx.ProCSharp.Exc2 {3 delegate double
2009-04-02 11:13:00 593
原创 在你的C++程序里实现委托
[说明] 本文不仅介绍了C++语言应用非常好的一种方法(我甚至觉得应该将它归结为一种设计模式),而且也是对C#语言中委托特性底层实现的一个很好的说明。 阅读本文,你应当对委托的概念有所了解;在讨论委托是实现时,你应当对标准模板库(STL)中的list容器以及迭代器(iterator)有所了解。在这篇文章中,暂不讨论类成员函数。 1.C#
2009-04-01 20:54:00 1285
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人