• 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
Re: Guidance for learner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guidance for learner


  • Subject: Re: Guidance for learner
  • From: "Barry" <email@hidden>
  • Date: Wed, 27 Jun 2007 16:04:40 +0100

Alan

Thanks for the helpful advice

I have a subclass of NSDocumentController as my delegate, so now I have

@interface MyDocController : NSDocumentController
{
       NSArray *dataFiles;
}
@end

and the code you provided is in the init method of MyDocController .

I need to access this data from each MyDocument (subclass of NSDocument) so I havewithin my 'readFromData' method

int i=1;
NSData *data=[[MyDocController dataFiles] objectAtIndex: i];
const char *p;
p=[data bytes];

I'm sure you can see a problem.
One: Does dataFiles (the NSArray) know that it's Objects are NSData Objects ?
If not, how do I coerce it (sorry, using C++ terminology here)
Similarly, [data bytes] returns a void* which needs coercing to byte*


All help welcome

Barry

_______________________________________________

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: Guidance for learner
      • From: "Daniel T. Staal" <email@hidden>
References: 
 >Guidance for learner (From: "Barry" <email@hidden>)
 >Re: Guidance for learner (From: "Alan Smith" <email@hidden>)

  • Prev by Date: Re: Explicitly changing first responder
  • Next by Date: Re: Two NSRects adjacent/touching?
  • Previous by thread: Re: Guidance for learner
  • Next by thread: Re: Guidance for learner
  • Index(es):
    • Date
    • Thread