摘要:
//.h文件#import <Foundation/Foundation.h>@interface Fraction : NSObject //定义一个新的类,里面有两个成员{ int numberator; int denominator;}-(void) print; //定义打印输出-(void) test_number;-(void) setNumberator:(int)n;-(void) setDenominator:(int)b;@end//.m文件中,具体实施#import "testone.h"@implementation Frac... 阅读全文
摘要:
-(void)redfile{ FILE *fp=fopen([[self bundlePath:@"information.txt"]UTF8String], "r"); char word[100]; if (!fp) { return; } while(fgets(word, 100,fp)) { word[strlen(word)-1] = '\0'; NSLog(@"%s",word); } fclose(fp);}//读取同目录下文件路jin-(NSString *)b... 阅读全文
摘要:
//.h 文件#import <UIKit/UIKit.h>@interface ViewController : UIViewController<UITextFieldDelegate> // type 选择outlet 然后在后面加上。<UITextFieldDelegate>@property (retain, nonatomic) IBOutlet UITextField *TXF; //.c文件 中。#import "ViewController.h"@interface ViewController ()@end@imple 阅读全文