摘要:
-(void)writeFileArray{ int i; NSLog(@"writeFileArray\n"); //新建userinfomation数组用来存一些信息 NSArray *userinfomation = [NSArray arrayWithObjects:@"One",@"Two",@"Three",@"four",@"five",@"six",@"seven",@"name",@"sc 阅读全文
摘要:
#import <UIKit/UIKit.h>@interface imageSet : UIViewController{ NSMutableArray *filePathArray; NSFileManager *localFileManager;} NSDirectoryEnumerator *myDirectoryEnumerator; NSFileManager *myFileManager=[NSFileManager defaultManager]; myDirectoryEnumerator=[myFileManager enumeratorAtP... 阅读全文
摘要:
NSString *path=@"/usr/local"; NSFileManager *myFileManager=[NSFileManager defaultManager]; NSDirectoryEnumerator *myDirectoryEnumerator; NSArray *directoryContents; myDirectoryEnumerator=[myFileManager enumeratorAtPath:path]; //列举目录内容 NSLog(@"用enumerator... 阅读全文
摘要:
// Do any additional setup after loading the view from its nib. NSLog(@"image vei"); UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0,45.0,300,300)]; imageView.image = [UIImage imageNamed:@"testimg.png"];//加载入图片[self.view addSubview:imageView];[imageView 阅读全文
摘要:
NSMutableDictionary *d = [NSMutableDictionary dictionary]; [d setObject:@"qingjoin" forKey:@"serveraddr"]; [d setObject:@"pwdpwd" forKey:@"userpwd"]; NSLog(@"%@",d); //新建一个对象。 id ontest = [d objectForKey:@"serveraddr"]; id sectest = [d obje 阅读全文
摘要:
//button 类的控制。取出当前button 显示的值NSString *server_addvarle = [sender titleForState:UIControlStateNormal]; NSLog(@"%@",server_addvarle); 阅读全文
摘要:
//.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 阅读全文
摘要:
- (IBAction)reslut_value:(id)sender{ /*分别表示年、月、日、时、分、秒*/ NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekCalendarUnit | NSHourCalendarUnit| NSMinuteCalendarUnit | NSSecondCalendarUnit; //******************** NSDate *dat... 阅读全文