archiving

Is there a better way to save a custom class to NSUserDefaults than encoding and decoding everything with NSCoder?

别等时光非礼了梦想. 提交于 2019-12-18 18:31:30
问题 My current class has around 50 lines just encoding and decoding variables in order for my class to be NSUserDefaults compatible. Is there a better way to handle this? Example: init(coder aDecoder: NSCoder!) { lightEnabled = aDecoder.decodeBoolForKey("lightEnabled") soundEnabled = aDecoder.decodeBoolForKey("soundEnabled") vibrateEnabled = aDecoder.decodeBoolForKey("vibrateEnabled") pulseEnabled = aDecoder.decodeBoolForKey("pulseEnabled") songs = aDecoder.decodeObjectForKey("songs") as! [Song]

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

谁说胖子不能爱 提交于 2019-12-12 07:08:40
问题 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

iPhone SDK: saving large amounts of text

♀尐吖头ヾ 提交于 2019-12-11 19:59:28
问题 I want to save large amounts of text then display them (first in table view, then in text view), however I am unsure which method to do it in. Should I use SQLite, or one of the archiving methods. 回答1: Your statement of "large amounts of text" is ambiguous. You could mean any of the following: A large set (eg 10,000 items) of small text (eg 30 words) items A small set (eg 50 items) of large text (eg 3,000 words) items A large set of large text items... I'll try and answer for each of those

How to disable code signing requirement

隐身守侯 提交于 2019-12-11 15:27:59
问题 After getting email for invalid binary from Appstore, fixed issue now trying to archive again, Xcode is giving error that code signing is required for product type Application' in SDK iOS 5.1. So how can i disable this code signing. Thanks for help. 回答1: In file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist change the CODE_SIGNING_REQUIRED YES to CODE_SIGNING_REQUIRED NO Restart Xcode 来源: https://stackoverflow.com

Archive/Serialize Objective-C Object with C++ Instance Variables

三世轮回 提交于 2019-12-11 12:28:39
问题 I am using OpenCV static library in Objective-C to do some image processing, and although my app is working quite well, on the device itself it is rather slow. A large chunk of the processing can actually done beforehand, so I have decided I will serialize this data and just load that up when the app starts instead. The data I need to serialize/archive is in an object of type CvSeq (openCV sequence - a pointer to a sequence of values). I basically want to save this to file so that it can be

Archive multiple IOS xcode target in command line

匆匆过客 提交于 2019-12-11 09:28:07
问题 I have an iOS Xcode project that has several targets. The number of targets in the project will continue to grow as the project progresses and expands. When I create a new version, it is a pain to have to go through each target and manually create the Archive. I looked into how to archive multiple targets using the command line, but none of the answers spoke to what I was trying to accomplish. Any help and guidance is appreciated. I believe that the following partial command is part of the

XCode hangs when archiving

怎甘沉沦 提交于 2019-12-11 03:16:01
问题 When I try to archive one certain project, Xcode fails to respond. If left alone he manages to open the Organiser after a long period. The archive is there. If removed manually from library/developer/xcode/archives Xcode responds again. It happens just with this project, all others archiving just fine. As if Xcode has major problems with the project. We are using Xcode 4.2.1 but tried 4.3 too (same result). Any idea what might be wrong? 回答1: I had similar problems I found that a symbolic link

iCloud - How to save archive containing array of custom objects

懵懂的女人 提交于 2019-12-06 06:59:27
问题 I have developed a small app that stores locally in iOS through archiving an array of custom objects containing: @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *dateCreated; @property (nonatomic, copy) NSString *desc; @property (nonatomic, copy) NSString *url; I want to sync said archive using iCloud and I believe the recommended mechanism is through a UIDocument subclass. All UIDocument examples I found utlilized a single instance with 1 single NSString, so

Zombie: Archiving Failed using Integration Menu

本小妞迷上赌 提交于 2019-12-06 03:34:07
问题 When I tried to archiving the project directly using Xcode menu ( Product - Archive ), it works well. But when I tried to execute it from the Integration menu (bot), I got this error: Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons. One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem. Some individual build task failures (up to 12) may be listed below. What happen?

Zombie: Archiving Failed using Integration Menu

╄→гoц情女王★ 提交于 2019-12-04 08:33:32
When I tried to archiving the project directly using Xcode menu ( Product - Archive ), it works well. But when I tried to execute it from the Integration menu (bot), I got this error: Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons. One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem. Some individual build task failures (up to 12) may be listed below. What happen? I couldn't find any error messages and completely have no clue on what's going on. I have tried to