The NSCoder abstract class declares the interface used by concrete subclasses to transfer objects and other Objective-C/Swift data items between memory and some other format.
Questions tagged [nscoder]
189 questions
0
votes
1 answer
Renamed Core Data Transformable
I'm using CoreData to manage my offline storage in my app. The data of the offline storage is saved in an custom NSObject as a transformable in the xcdatamodel.
My current version in the app (v1.0) is storing the Navigation class.
I needed to rename…

mariusLAN
- 1,195
- 1
- 12
- 26
0
votes
2 answers
Save custom class objects in NSUserDefaults in Swift
Im trying to save some objects in an array but my objects are used inherited properties
But when trying to read the object it says
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -decodeObjectForKey: cannot be…

slozano95
- 278
- 7
- 22
0
votes
2 answers
Push ViewController with coder aDecoder: NSCoder
I'm trying to push a view controller using:
var vc2 = ViewController2()
self.navigationController?.pushViewController(vc2, animated: false)
but in my second view controller, I'm have:
required init(coder aDecoder: NSCoder) {
super.init(coder:…

Pablo Picasso
- 251
- 1
- 4
- 13
0
votes
1 answer
How to unarchive custom array with NSUserDefaults?
I'm saving an array of type ClassA to NSUserDefaults. ClassA look like this:
class ClassA :NSObject, NSCoding{
init (descriptionParam: String) {
self.description = descriptionParam
}
var description: String?
required…

4thSpace
- 43,672
- 97
- 296
- 475
0
votes
1 answer
Accessing Variables from FirstViewController from SecondViewController in Swift
I've been trying to access variables located within my FirstViewController class from the SecondViewController. I've tried instantiating the firstviewcontroller from the secondviewcontroller but I've having extreme troubles with this NSCoder deal,…

Clement
- 367
- 2
- 18
0
votes
1 answer
Saving High Scores with SpriteKit and iOS 7
I am creating an app that needs to store high scores from multiple different levels. I'm using the excellent tutorial over at http://www.raywenderlich.com/63235/how-to-save-your-game-data-tutorial-part-1-of-2 as a basis for what I'm trying to do. As…

Cameron Frank
- 47
- 9
0
votes
1 answer
CALayer values not applied to UIControl
WORKGROUND
Create a UIView with UILabel and UIButton. Here i have set layer properties of UIButton below:
[self.btnDropdown.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[self.btnDropdown.layer setBorderWidth:0.8f];
[self.btnDropdown.layer…

Kampai
- 22,848
- 21
- 95
- 95
0
votes
1 answer
NSKeyedUnarchiver unarchiveObjectWithFile decodeBytesForKey EXC_BAD_ACCESS code=1 when retrieving data
I need a little help with decodeBytesForKey using NSKeyedUnarchiver unarchiveObjectWithFile. I appear to be writing everything correctly but reading the data gives me a EXC_BAD_ACCESS error. I'm trying to deserialize data and have gotten confused…

Patricia
- 5,019
- 14
- 72
- 152
0
votes
1 answer
Save data in ApplicationDidEnterBackground terminating due to background thread pause delay
My app currently downloads data from a web service. The data received is processed using background serial queues.
I also want to save the data to the file system when the user goes into background mode and use NSCoder to do this. Based on…

instAustralia
- 51
- 3
0
votes
0 answers
NSCoder game data storage/retrieve sanity check
Just wanted to get a sanity check on this code for storing and retrieving user data for iOS 7. It's not working but I'm not seeing the issue.
GameData.h
#import
@interface GameData : NSObject
{
int…

J C
- 63
- 1
- 7
0
votes
1 answer
Segue With NSUserDefaults + NSCoder Object
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"ShowWordDetailsTwo"]) {
NSIndexPath *indexPath = nil;
Words *word = nil;
indexPath = [self.tableView…

Mou某
- 556
- 3
- 10
- 32
0
votes
2 answers
encode NSInteger doesn't work on 64 bit simulators - objective c
I'm quite new to Objective c. In my app I want to save in a .plist file an object made of a NSString and three NSInteger token from three segmented controls. It is working fine on 32 bit simulators and devices, but in 64 bit a null object is passed,…

Bebo Yasu
- 1
- 3
0
votes
2 answers
Where Do i add my custom tableview cell label in my UITableview when using NSCoder?
Where Do i add my custom tableview cell label in my UITableview when using NSCoder?
i already Created The UITableViewCell class and hooked everything up in interface builder.
I tried to replace cell.textLabel.text = oneName.name; with…

Andrew Stallone
- 37
- 6
0
votes
1 answer
NSString cannot decode class version XXXX
I'm implementing my own keyed NSCoder subclass and decoding is failing for an NSString.
If I do something like the following:
MyUnarchiver *aDecoder = [[MyUnarchiver alloc] initWithData:someArchivedData];
NSString *aString = [[NSString alloc]…

Ncat
- 417
- 3
- 10
0
votes
2 answers
Data gets truncated when sending over NSStream
Ok so I have been at this bug all day, and I think I've got it narrowed down to the fundamental problem.
Background:
I am working on an app that has required me to write my own versions of NSNetService and NSNetServiceBrowser to allow for Bonjour…

RyanM
- 4,474
- 4
- 37
- 44