tilde #6379(2008/05/30 02:40 GMT) [ Objective-C ] Rating0/0=0.00
開発環境: Mac OS X 10.5.2 Xcode 3.1 (Beta)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#import <Foundation/Foundation.h> #define FilePath @"fixedlengthdata.txt" const unsigned int RecordSize = 12 + 12 + 1 + 3 + 4 + 2 + 31 * 1502; const unsigned int RecordCount = 500; int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSData* data = [NSData dataWithContentsOfMappedFile:FilePath]; if ( data ) { NSMutableArray* array = [NSMutableArray array]; for ( int i = 0; i < RecordCount; i++ ) [array addObject:[data subdataWithRange:NSMakeRange( i * RecordSize, RecordSize )]]; } [pool drain]; return 0; }
Rating0/0=0.00-0+
[ reply ]
tilde #6379() [ Objective-C ] Rating0/0=0.00
開発環境: Mac OS X 10.5.2 Xcode 3.1 (Beta)
Rating0/0=0.00-0+
[ reply ]