2010年6月11日

Cocoa 接口的定义于检测

摘要: //-------接口定义@protocol Printing-(void) print;@end---------//----实现接口 Printing -------//----接口中的print 方法不必写出来@interface Fraction : NSObject <Printing,NSCopying> { int numerator; int denominator;}-(Fraction*) initWithNumerator:(int)n denominator:(int)d;-(int) numerator;-(int) denominator;-(void) 阅读全文

posted @ 2010-06-11 15:15 老代哥哥 阅读(248) 评论(0) 推荐(0) 编辑

XCode Cocoa 学习日志之二;

摘要: -----------利用 Categories 实现私有方法.#import <Cocoa/Cocoa.h>@interface MyClass: NSObject-(void) publicMethod;@end----------------MyClass.m----#import "MyClass.h"// private methods@interface MyClass (Private)-(void) privateMethod;@end@implementation MyClass (Private)-(void) privateMethod { 阅读全文

posted @ 2010-06-11 14:31 老代哥哥 阅读(120) 评论(0) 推荐(0) 编辑

XCode 下的开发 类的方法扩展 读书日志记录1.

摘要: @interface Fraction : NSObject { int numerator; int denominator;}-(Fraction*) initWithNumerator:(int)n denominator:(int)d;-(int) numerator;-(int) denominator;-(void) print;-(void) setNumerator:(int)n;-(void) setDenominator:(int)n;-(void) setNumeratorAndDenominator:(int) num andDeno:(int) den... 阅读全文

posted @ 2010-06-11 14:18 老代哥哥 阅读(171) 评论(0) 推荐(0) 编辑

XCode 开发时,一个小BUG,记录之.

摘要: 1):Rectangle.h//// Created by dhanzhang on 10-6-11.// Copyright 2010 __MyCompanyName__. All rights reserved.//#import <Cocoa/Cocoa.h>@interface Rectangle : NSObject {int width;int height;}-(Rectangle*) initWithWidth: (int) w height: (int) h;-(void) setWidth: (int) w;-(void) setHeight: (int) h; 阅读全文

posted @ 2010-06-11 11:57 老代哥哥 阅读(138) 评论(0) 推荐(0) 编辑

导航