Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-16-2010, 11:16 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 50
o2fill is on a distinguished road
Default Decoding NSData objects

I am trying to recover an Mutable array of NSNumber objects. I'm getting an error indicating that, during unarchiving, NSObject does not recognize the selector which I guessed meant that either NSMutableArray or NSNumber did not conform to NSCoding protocol, but they both do. So I'm stumped about what the debugger (see below) is trying to tell me. What am I missing?

Here's the code.
Code:
//set up best times array
	//the first four integers are unhinted best times, the last four are hinted times
	NSData *dataRepresentingBestTimes = [defaults objectForKey:@"bestTimes"];
	if (dataRepresentingBestTimes != nil)
	{
        NSLog(@"got data");
		NSArray *timesArray = [NSKeyedUnarchiver unarchiveObjectWithData:dataRepresentingBestTimes];
		bestTimes = [NSMutableArray arrayWithArray:timesArray];
		NSLog(@"best times from data length = %d", [bestTimes count]);
	} else {
		bestTimes = [NSMutableArray arrayWithObjects: defaultTime,defaultTime, defaultTime, defaultTime,defaultTime,defaultTime, defaultTime, defaultTime,nil];
		NSLog(@"had to build our own array, length is: %d", [bestTimes count]);
	}
and here's the error from the debugger:

#0 0x0081f004 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1 0x97d98e3b in objc_exception_throw
#2 0x0084983b in -[NSObject doesNotRecognizeSelector:]
#3 0x007e0676 in ___forwarding___
#4 0x007bc6c2 in __forwarding_prep_0___
#5 0x0078c75c in CFDataGetBytePtr
#6 0x002929f4 in -[NSKeyedUnarchiver initForReadingWithData:]
#7 0x002f131c in +[NSKeyedUnarchiver unarchiveObjectWithData:]


Thanks for any pointers.
o2fill is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 309
16 members and 293 guests
2ndSegment, cayladv57, cgokey, dermotos, djohnson, Domele, Hamad, heshiming, linkmx, markuschow, pungs, Rudy, Sloshmonster, teebee74, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:58 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0