Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
July 25, 2017, 01:40:58 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: 19.1 and 19.2 question  (Read 1670 times)
getawaybird
Newbie
*
Posts: 4


Email
« on: August 08, 2011, 04:12:28 PM »

I run 19.1 from Xcode:

int main (int argc, const char * argv[])
{

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
 
    NSDictionary *glossary = [NSDictionary dictionaryWithObjectsAndKeys:
                              @"A class defined so other classes can inherit from it.",
                              @"abstract class",
                              @"To implement all the methods defined in a protocol",
                              @"adopt",
                              @"Storing an object for later use.",
                              @"archiving",
                              nil ];
    if ([glossary writeToFile:@"glossary" atomically:YES] == NO)
        NSLog(@"save to file failed!");
   
    [pool drain];
    return 0;
}

and it took me awhile to find, but it creates the glossary file in the Debug file along with the .exe. So i tried taking the .exe out of the debug folder and onto my desktop to see if it would create another glossary file, but it didn't. Then i tried building it without running it, still it wouldn't create the glossary file anywhere.

But if i run 19.2:

int main (int argc, const char * argv[])
{

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
 
    NSDictionary *glossary;
    glossary = [NSDictionary dictionaryWithContentsOfFile:@"glossary"];
   
    for ( NSString *key in glossary )
        NSLog(@"%@: %@", key, [glossary objectForKey:key]);   
   
    [pool drain];
    return 0;
}

it can read the glossary file no matter where i put the .exe.
So I guess my question is, where are these XML property list files saved? And how accessible are they to different programs I build. I hope this makes sense.
Thank you
Marc
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114



« Reply #1 on: August 11, 2011, 09:36:47 PM »

Marc,

I'm confused about how you build and ran the program.  The best way to control where the application is running is by running it from inside Terminal.  And the best way to control where the glossary is created and/or read from is by using a full path to the glossary file (and not a relative path like in the example), or to set the current directory path first inside the app to set the context for any future relative file references.

Cheers,

Steve
Logged
Coninidabof
Newbie
*
Posts: 1


[url=http://www.sellyourmobile.ru]продам телефон в оренбурге[/url]


WWW
« Reply #2 on: December 29, 2011, 12:44:42 PM »

I mean play the MTS/AVCHD files without any jittery.  Im not worried on which player to use VLC does the job, but the question is more of what card is needed?  do I really need a graphics/video card?  if so what should I look for NVIDIA ? which one?
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

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 пЅ© 2009 classroomM.com. All rights reserved.