简体   繁体   中英

iPhone - iOS compatibilty in Apple doc

Ican read in the apple doc for NSData :

- (BOOL)writeToFile:(NSString *)path options:(NSDataWritingOptions)mask error:(NSError **)errorPtr
Parameters

mask
A mask that specifies options for writing the data. Constant components are described in “NSDataWritingOptions”.

Available in iOS 2.0 and later.

and for NSDataWritingOptions :

Options for methods used to write NSData objects.

enum {
   NSDataWritingAtomic = 1UL << 0,
   NSDataWritingCoordinated = 1UL << 2,
   NSDataWritingFileProtectionNone     = 0x10000000,
   NSDataWritingFileProtectionComplete = 0x20000000,
   NSDataWritingFileProtectionMask     = 0xf0000000,
};
typedef NSUInteger NSDataWritingOptions;

NSDataWritingAtomic
Available in iOS 4.0 and later.

NSDataWritingCoordinated
??????

NSDataWritingFileProtectionNone
Available in iOS 4.0 and later.

NSDataWritingFileProtectionComplete
Available in iOS 4.0 and later.

NSDataWritingFileProtectionMask
Available in iOS 4.0 and later.

How may I use a 2.0 method that takes 4.0 arguments when compiling for 3.x target ???

You should be able to call the method in the 2.0 way for 3.x targets. You won't be able to call it with the 4.0 format or values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM