Amazon.com Widgets Prog 16.1
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2013, 05:31:49 AM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Programming in Objective-C, 4th edition
| |-+  Chapter 16
| | |-+  Prog 16.1
Pages: [1]   Go Down
Print
Author Topic: Prog 16.1  (Read 512 times)
symanski
Newbie
*
Posts: 4






« on: July 03, 2012, 09:20:53 AM »

I've had a few problems with this example program, but I have managed to work around them.

Firstly, you need to know where your program is store, so after NSDictionary *attri; line put:

Code: (Objective-C)
       system ("pwd; ls -l");

This will then give you the path name using a typical unix command.   You can then use Finder to browse to this location.

Secondly, create the "testfile" using the method described on page 374.   If you create a file using the text editor it's an RTF type and therefore has more in it!   You can tell when you look at the files sizes as the RTF is considerably larger.

To be fair to Mr Kochan he does on page 376 describe that the files are in a different location than where you'd expect them to be!   However, I'd put in a couple of test lines that didn't work:

Code: (Objective-C)
        if ([fm changeCurrentDirectoryPath:@"~"]
            == NO ) {
            NSLog(@"Unable to change directory");
            }
        NSLog(@"Current path %@", [fm currentDirectoryPath]);

Which reports that it's unable to change director, and then that the current path is (null).   Any suggestions  why please?   I think I'm about to battle this in the next exercise!

Logged
johnyorke
Newbie
*
Posts: 18


Email




« Reply #1 on: August 21, 2012, 10:59:46 AM »

Thanks man, helped a lot!
Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.