Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:05:44+00:00 2026-06-17T09:05:44+00:00

In the tutorial there is the following declaration: -(BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile; I’m interpreting this

  • 0

In the tutorial there is the following declaration:

-(BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile;

I’m interpreting this as writeToFile method returns a BOOL result. It takes 2 parameters. The first is an NSString reference. The second is the result of calling atomically and passing it a BOOL value.

Did I get that right?

The tutorial goes on to say you call the above method like this:

BOOL result = [myData writeToFile:@"/tmp/log.txt" atomically:NO];

which is find. But I wonder if I MUST use “atomically:NO”

Could I have done something like

resultOfAtomically = atomically:NO
BOOL result = [ myData writeToFile:@"/tmp/log.txt" resultOfAtomically ];

assuming I declared resultOfAtomically properly.

Also, does prepending @ to "/tmp/log.txt" mean something like “give me the reference NOT the value” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:05:45+00:00Added an answer on June 17, 2026 at 9:05 am

    The text atomically introduces the second parameter of the writeToFile:atomically: method, it is not a separate function. Therefore, you cannot call simply atomically:NO. This would be correct, however:

    BOOL myBool = NO;

    BOOL result = [myData writeToFile:@"/tmp/log.txt" atomically:myBool];

    When talking about Objective-C methods, you would not call this method “writeToFile”, you would call it “writeToFile:atomically:”. By this syntax you know that the method expects two parameters (one for each colon).

    Here’s a way to think about how the method declaration breaks down:

    -(BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile;

    - = defining an instance method (+ would be for a class method).

    (BOOL) = returning a boolean value.

    write = this method is about writing something (nothing magic, just a friendly word choice – could have been print or something else).

    ToFile:(NSString *)path = the first parameter of the method, path, is an NSString pointer and the friendly text “ToFile” (again just a word choice, nothing special) hints that I need to provide a file path for that parameter.

    atomically:(BOOL)useAuxiliaryFile; = the second parameter of the method, useAuxiliaryFile, is a boolean and the friendly text “atomically” (still nothing special) hints that the boolean value determines whether or not to write the file atomically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following this tutorial: http://developer.android.com/training/basics/firstapp/running-app.html#Emulator In it there is a simple code for a
I am following BalusC's DAO Tutorial , where there is this function: private static
I'm following a groovy tutorial and there is a code like this: def fruit
I'm following this tutorial, but I'm faced with a weird problem. There's a part
I was following a tutorial and i noticed that there was a linearlayout that
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I'm following Scott Guthries MVC tutorial ( http://nerddinnerbook.s3.amazonaws.com/Part6.htm ) and there's something I don't
I am following this tutorial: http://docs.djangoproject.com/en/dev/ref/contrib/messages/ but I get this error: Error: No module
I was following this tutorial http://nepomucenobr.com.br/blog/post/Generating-e2809cdummy-datae2809d-with-Visual-Studio.aspx and I got to the point where I
I'm following this tutorial for creating automated sitemaps in CakePHP. Everything is easy, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.