• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
isKindofClass with NSData and NSKeyUnarchiver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

isKindofClass with NSData and NSKeyUnarchiver


  • Subject: isKindofClass with NSData and NSKeyUnarchiver
  • From: Philip Vallone <email@hidden>
  • Date: Thu, 27 May 2010 05:21:32 -0400

Hello,

I am passing different types of data to NSData (NSString, NSArray, UIImage).  I am trying to find out what kind of data t is so I know how to handle the NSData when I receive it.  The below code is an example of how I am trying to do this but its always returning null. What am I doing wrong?

	NSString *somedata = [[NSString alloc] initWithString:@"Some string"];
	NSData * set = [NSKeyedArchiver archivedDataWithRootObject:[somedata dataUsingEncoding:NSASCIIStringEncoding]];
	NSData * unset = [NSKeyedUnarchiver unarchiveObjectWithData:set];
	NSLog(@"Class Type %@", [unset isKindOfClass:[NSKeyedUnarchiver class]]);
	[somedata release];

Thanks,

Phil

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: isKindofClass with NSData and NSKeyUnarchiver
      • From: Ken Thomases <email@hidden>
    • Re: isKindofClass with NSData and NSKeyUnarchiver
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Re: window level
  • Next by Date: Re: isKindofClass with NSData and NSKeyUnarchiver
  • Previous by thread: Re: selecting a row of a UITableView programatically
  • Next by thread: Re: isKindofClass with NSData and NSKeyUnarchiver
  • Index(es):
    • Date
    • Thread