可有三種模式
1.依Page寬度
2.依Window寬度
3.依80個字元寬度
效果如下:
開啟前:
開啟後:

@interface Member : NSObjext{
NSString *name;
NSString *addr;
NSString *tel;
NSInteger *wallet;
}
read方法
NSString *name = [member valueForKey:@"name"];
NSString *name = [application valueForKeyPath:@"member.name"];
[member setValue:@"bob" forKey:@"name"];
[application setValue:@"bob" forKey:@"member.name"];
@interface Member : NSObjext{
NSString *name;
NSString *addr;
NSString *tel;
NSInteger wallet;
}
@property (nonatomic,retain) NSString *name;
@property (nonatomic,retain) NSString *addr;
@property (nonatomic,retain) NSString *tel;
@property (nonatomic,retain) NSString wallet;
@implementation Member
@synthesize name,addr,tel,wallet;
@end
NSDictionary *properties = [self dictionaryWithValuesForKeys:[NSArray arrayWithObjects:@"name",@"addr",@"tel",@"wallet",nil];
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:@"bob",@"name",@"addr",@"綠島",@"0912345678", [NSNumber numberWithInt:30000],@"wallet",nil]; [self setValuesForKeyWithDictionary:properties];
#import@interface NSObject(Private) +(NSArray *)propertyName; @end @implementation NSObject (Private) +(NSArray *)propertyNames{ unsigned int cnt,i; objc_property_t *properties = class_copyPropertyList([self class],&cnt); NSMutalbeArray *propNames = [NSMutableArray arrayWithCapacity:cnt]; for(i = 0 ; i < cnt ; i++){ objc_property_t property = properties[i]; const char *propName = property_gerName(property); NSString *propertyName = [NSString stringWithUTF8String:propName]; [propNames addObject:propertyName]; } free(properties) return propNames; } @end NSDictionary *properties = [self dictionaryWithValuesForKeys:[User propertyNames]];
#if defined(_DEBUG_)
#ifndef NSLog
#define NSLog(m,args...) NSLog(m,##args)
#endif
#else
#ifndef NSLog
#define NSLog(m,args...)
#endif
#endif