Search Results

Search found 9 results on 1 pages for 'beomseok'.

Page 1/1 | 1 

  • I don't know How to release NSString.

    - by Beomseok
    NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [path objectAtIndex:0]; NSString *databasePath = [documentsDirectory stringByAppendingPathComponent:@"DB"]; NSString *fileName = [newWordbookName stringByAppendingString:@".csv"]; NSString *fullPath = [databasePath stringByAppendingPathComponent:fileName]; [[NSFileManager defaultManager] createFileAtPath:fullPath contents:nil attributes:nil]; [databasePath release]; //[fileName release]; Error! //[fullPath release]; Error! //NSLog(@"#1 :databasePath: %d",[databasePath retainCount]); //NSLog(@"#1 :fileName: %d",[fileName retainCount]); //NSLog(@"#1 :fullPath: %d",[fullPath retainCount]); Hi guys, I'm using this code and want to release NSString* .. so, I declare fileName, fullPath, and databasePath of NSString. But database is released, fileName, fullpath doen't release. I don't know why it happen. I know that NSArray is Autoreleased. But Is documentsDirectory autoreleased? (newWordbookName is nsstring type) I hope that I look through a document about iPhone memory management. Please advice for me.

    Read the article

  • I have a question about variable release in global class.

    - by Beomseok
    + (void)findAndCopyOfDatabaseIfNeeded{ NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [path objectAtIndex:0]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *databasePath = [documentsDirectory stringByAppendingPathComponent:@"DB"]; BOOL success = [fileManager fileExistsAtPath:databasePath]; if(!success){ NSString *resourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"DB"]; [fileManager copyItemAtPath:resourcePath toPath:databasePath error:NULL]; } NSString *tracePath = [documentsDirectory stringByAppendingPathComponent:@"Trace"]; BOOL traceDir = [fileManager fileExistsAtPath:tracePath]; if(!traceDir){ NSString *resourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Trace"]; [fileManager copyItemAtPath:resourcePath toPath:tracePath error:NULL]; } NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"yyyy"]; NSDate *today = [[NSDate alloc]init]; NSString *resultYear = [dateFormatter stringFromDate:today]; NSString *traceYearPath = [tracePath stringByAppendingPathComponent:resultYear]; BOOL yearDir = [fileManager fileExistsAtPath:tracePath]; if (!yearDir) { [fileManager createDirectoryAtPath:traceYearPath attributes:nil]; } //[resultYear release]; ? //[today release]; ? //[dateFormatter release]; ? } I'm using global class like this [ + (void)findAndCopyOfDatabaseIfNeeded ]. hm,, I don't know NSArray, NSString and NSFileManager are released. Variable release or Not release ? please advice for me.

    Read the article

  • Do you use cParseCSV source on iphone?

    - by Beomseok
    link! I'm using cParseCSV. I'm want to encode text of NSUTF8StringEncoding. But It does not work. 2010-04-05 08:53:16.616 test[12086:207] Fine thanks. 2010-04-05 08:53:16.617 test[12086:207] ????, ????. 2010-04-05 08:53:16.617 test[12086:207] Thank you. 2010-04-05 08:53:16.618 test[12086:207] ?????. 2010-04-05 08:53:16.618 test[12086:207] I'm all right. 2010-04-05 08:53:16.619 test[12086:207] ?? ????. 2010-04-05 08:53:16.620 test[12086:207] Oh, pretty good. 2010-04-05 08:53:16.620 test[12086:207] ?, ?? ???? 2010-04-05 08:53:16.621 test[12086:207] Alive and kicking. 2010-04-05 08:53:16.621 test[12086:207] ???????. 2010-04-05 08:53:16.622 test[12086:207] So so. 2010-04-05 08:53:16.623 test[12086:207] ?? ???. 2010-04-05 08:53:16.623 test[12086:207] Not too bad. 2010-04-05 08:53:16.624 test[12086:207] (null) 2010-04-05 08:53:16.625 test[12086:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument' I don't know Why it happen...Please advice for me.

    Read the article

1