• 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
NSData category
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSData category


  • Subject: NSData category
  • From: Torsten Curdt <email@hidden>
  • Date: Tue, 16 Feb 2010 14:21:55 +0100

I am really really irritated. Got an iPhone project. Got quite some
categories with additions to the standard APIs. All good.
Just the darn NSData refuses to accept the category ... and I have no
clue why. It's as simple as

 @interface NSData (NSDataAdditions)
 + (id) dataWithHexString:(NSString*)theHex;
 - (NSString*) hexString;
 @end

I've tried prefixing the methods, I've use a more exotic category name
than just NSDataAdditions. Whatever I am trying ... the class/object
does not have the selectors. Even something simple as

    NSData *data = [NSData data]; //[NSData dataWithHexString:@"aabbccdd"];
    NSLog(@"@%", [data hexString]);

gives me

  -[NSConcreteData hexString]: unrecognized selector sent to instance ...

Why NSConcreteData? Does it create a different object under the hood
so my category is not applicable?
I've used NSData categories before and the worked just fine.

Is there a way in gdb to look at the categories/method lists easily?
Or should they selectors show up through class_copyMethodList?

Could really use some ideas here.

cheers
--
Torsten
_______________________________________________

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: NSData category
      • From: Mike Abdullah <email@hidden>
    • Re: NSData category
      • From: Torsten Curdt <email@hidden>
    • Re: NSData category
      • From: "email@hidden" <email@hidden>
    • Re: NSData category
      • From: "Paul Sanders" <email@hidden>
  • Prev by Date: ImageIO on iPhone
  • Next by Date: Re: NSData category
  • Previous by thread: Re: ImageIO on iPhone
  • Next by thread: Re: NSData category
  • Index(es):
    • Date
    • Thread