archiving

float INFINITY can be archived by NSCoder, but not dearchived

不羁的心 提交于 2019-12-04 02:18:36
I have to archive a float with value INFINITY , and later to dearchive it. Here is my example code: Object to be archived: @interface CodeInf : NSObject <NSCoding> @end @implementation CodeInf - (void)encodeWithCoder:(NSCoder *)encoder { float inf = INFINITY; [encoder encodeFloat: inf forKey:@"INFINITY"]; } - (id)initWithCoder:(NSCoder *)decoder { if (self = [super init]) { float decodedInf = [decoder decodeFloatForKey: @"INFINITY"]; } return self; } @end And here is the archiving/dearchiving code: CodeInf *myCodeInf = [[CodeInf alloc] init]; NSData *data = [NSKeyedArchiver

NSKeyedArchiver and NSKeyedUnarchiver with NSMutableArray

回眸只為那壹抹淺笑 提交于 2019-12-03 11:04:26
问题 I'm hoping this isn't something to do with the fact that I'm using a Mutable array here, but this one is baffling me so it wouldn't surprise me if that were the case. BACKGROUND: I have made a small database which is essentially an NSMutableArray containing custom objects, which we can call recordObjects. I set up the array: database = [[NSMutableArray alloc] init]; and my custom object, called "recordObject" contains the following variables and inits: NSString *name; int anInt; Bool aBool; I

NSKeyedArchiver and NSKeyedUnarchiver with NSMutableArray

家住魔仙堡 提交于 2019-12-03 00:35:16
I'm hoping this isn't something to do with the fact that I'm using a Mutable array here, but this one is baffling me so it wouldn't surprise me if that were the case. BACKGROUND: I have made a small database which is essentially an NSMutableArray containing custom objects, which we can call recordObjects. I set up the array: database = [[NSMutableArray alloc] init]; and my custom object, called "recordObject" contains the following variables and inits: NSString *name; int anInt; Bool aBool; I also synthesized methods so I can make calls like: aString = [[database objectAtIndex:someIndex] name]

Is there a way to view your app's .entitlements file from your app's .ipa archive?

夙愿已清 提交于 2019-12-02 23:31:24
I think there's an issue with my app's .entitlements file when a .ipa is created and so I want to check the Bundle ID of the entitlements file. There's a fairly complicated build script I am using to change some stuff in there before building so I want to see what the final product is. I know that there used to be an Entitlements.plist that I could get off of the ipa but it doesn't seem to be there any longer. Is there any way to access the .entitlements file now? Sure, unzip the .ipa file which will create a Payload directory. Inside of the Payload directory is the application package. Right

iOS: XMPP: Message Archiving for Group Chat Message

别说谁变了你拦得住时间么 提交于 2019-12-01 09:14:01
All one-one chat is send with Message Type as Chat. Thus the Message Archiving technique (shown below) worked fine for me to save/retrieve chat history. // Setup message archiving xmppMessageArchivingStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance]; xmppMessageArchiving = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:xmppMessageArchivingStorage]; [xmppMessageArchiving setClientSideMessageArchivingOnly:YES]; // Activate xmpp modules [xmppMessageArchiving activate:xmppStream]; // Add delegate [xmppMessageArchiving addDelegate:self delegateQueue:dispatch_get_main

iOS: XMPP: Message Archiving for Group Chat Message

这一生的挚爱 提交于 2019-12-01 06:47:11
问题 All one-one chat is send with Message Type as Chat. Thus the Message Archiving technique (shown below) worked fine for me to save/retrieve chat history. // Setup message archiving xmppMessageArchivingStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance]; xmppMessageArchiving = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:xmppMessageArchivingStorage]; [xmppMessageArchiving setClientSideMessageArchivingOnly:YES]; // Activate xmpp modules [xmppMessageArchiving activate

Archiving / Unarchiving results in initForReadingWithData incomprehensible archive

若如初见. 提交于 2019-11-30 07:39:46
问题 I've implemented an save on applicationWillTerminate and load on applicationWillFinishLoading . There is a complete object tree, all implement the NSCoding protocol and I've check the types I enter. One of the classes also stores an NSMutableData to the NSKeyedArchive , which I suspect might break unarchiving occasionally. Weirdly enough, sometimes it works and sometimes it doesn't. I suspect some content in the NSMutableData will break the archiving. I use encodeObject on all objects, except

What is the advantage of using armv7s support In Valid Architecture?

穿精又带淫゛_ 提交于 2019-11-30 06:58:58
I'm working on an iOS app which supports iOS 4.3 and above. Due to some frameworks I cant Archive it for armv7s,so I have removed armv7s support. Will it reduce application performance? What is the advantage of using armv7s? Surprisingly there weren't a lot of differences in the machine code produced for the two different architectures; overall, the armv7s code does not look much different from the armv7 code. However, there were two specific differences that caught my eye. The first difference affects integer division. The armv7s architecture has two new integer division instructions that

iPhone — is initWithCoder an exception to the usual designated initializer design pattern?

一世执手 提交于 2019-11-29 22:30:33
I have a class MyClass. It has instance variables passedInVar1, passedInVar2, etc. whose values will be passed in from the object that requests the initialization. It also has instance variables decodedVar1, decodedVar2, etc. that will be decoded from an archive -- or set to a default value if there is no archive. According to Apple , When an object receives an initWithCoder: message, the object should first send a message to its superclass (if appropriate) to initialize inherited instance variables, and then it should decode and initialize its own instance variables. But Apple also says that

What is the advantage of using armv7s support In Valid Architecture?

孤街浪徒 提交于 2019-11-29 08:06:40
问题 I'm working on an iOS app which supports iOS 4.3 and above. Due to some frameworks I cant Archive it for armv7s,so I have removed armv7s support. Will it reduce application performance? What is the advantage of using armv7s? 回答1: Surprisingly there weren't a lot of differences in the machine code produced for the two different architectures; overall, the armv7s code does not look much different from the armv7 code. However, there were two specific differences that caught my eye. The first