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 6773655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:41:38+00:00 2026-05-26T15:41:38+00:00

Whenever I load a UIDocument from iCloud, I check its state like so: NSLog(@Library

  • 0

Whenever I load a UIDocument from iCloud, I check its state like so:

NSLog(@"Library loadFromContents: state = %d", self.documentState);

In some cases I have received documentState 8 or 12 which have caused crashes. I am now wondering what exactly the 8 and 12 stands for. As far as I’m aware, documentState is a bit field, so it has many different flags. The docs reveal that:

enum {
UIDocumentStateNormal          = 0,
UIDocumentStateClosed          = 1 << 0,
UIDocumentStateInConflict      = 1 << 1,
UIDocumentStateSavingError     = 1 << 2,
UIDocumentStateEditingDisabled = 1 << 3   }; 
typedef NSInteger UIDocumentState;

However, I have no idea how to interpret this in my situation. How do I find out what 8 and 12 stand for?

  • 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-05-26T15:41:39+00:00Added an answer on May 26, 2026 at 3:41 pm

    Inside the enum they do some bit-shifting. They could have also written it like this:

    enum {
    UIDocumentStateNormal          = 0,
    UIDocumentStateClosed          = 1,
    UIDocumentStateInConflict      = 2,
    UIDocumentStateSavingError     = 4,
    UIDocumentStateEditingDisabled = 8   }; 
    typedef NSInteger UIDocumentState;
    

    A bit shift to the left is basically 2 to the power of whatever number is given after the shift operator… 1<<1 means 2^1, 1<<2 means 2^2, etc …

    A state of 8 means UIDocumentStateEditingDisabled and 12 means UIDocumentStateEditingDisabled and UIDocumentStateSavingError

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

Sidebar

Related Questions

Whenever I load ONLY the 1.3 or 1.4 library on an html page im
for some reason, whenever I dynamically load a swf on a $(document).ready() by writing
I want some personally developed JavaScript code to execute whenever I load a page
From what i see in the various videos/screenshots, whenever you load an executable, the
I'm getting an error whenever I load Management Studio or open a folder in
Whenever I use the signal/slot editor dialog box, I have to choose from the
By default, phpMyAdmin shows me 30 rows whenever I load a table (the query
Whenever I try to load a properties file by below method. I get an
Whenever I load a Task class, the Document property is always null, despite there
I am using TinyMCE ( http://tinymce.moxiecode.com/ ) in a .NET page. Whenever I load

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.