• 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: Accessing structure member NSDate in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing structure member NSDate in NSTableView


  • Subject: Re: Accessing structure member NSDate in NSTableView
  • From: Gilles Celli <email@hidden>
  • Date: Fri, 10 Nov 2006 15:26:39 +0100

Hello,

Stephane was right: I had to retain the NSDate object, now it works!

Just a question for Scott:
What do you mean exactly by your writing (sounds interesting to me :-)

"You might want to just keep two copies of the array: one "source" C- style array, and one "target" NSArray. When one changes, you rebuild the other one. I think it would simplify all of your code here."

Do you mean that I have to copy the C-style array to NSArray to gain performance before writing it to the NSTableView ?
Daily I would like to acquire about maxium 17280 shots (every 5 seconds a day) for 20 channels from a multimeter....
so to have better performance is always good


Gilles



On Nov 9, 2006, at 6:29 PM, Stephane wrote:


On Nov 9, 2006, at 5:59 PM, Gilles Celli wrote:

Hello,

My problem: How to access the structure member NSDate *acqDate without copying it to a new structure ?
My code crashes NSTableView !!!



My KeithleyMultimeter class (for performance reason I don't want to use NSArray but structures instead, this was discussed here several weeks ago):


@interface KeithleyMultimeter : NSObject {

struct keithley_struct {

		NSDate *acqDate;

		double channel[MAX_NBR_OF_CHANNELS];

} k2700_data[MAX_ACQ_DATA_PER_DAY];

[...]

Its' mainly crashing when accessing the structure member NSDate....

Why ?

Could it be possible that you do:

k2700_data[index]. acqDate=[NSDate dateWithSomeMethodFromSomewhereWhichReturnsAnAutoreleasedObject];

instead of:

k2700_data[index]. acqDate=[[NSDate dateWithSomeMethodFromSomewhereWhichReturnsAnAutoreleasedObject] retain];

?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Accessing structure member NSDate in NSTableView (From: Gilles Celli <email@hidden>)
 >Re: Accessing structure member NSDate in NSTableView (From: Stephane <email@hidden>)

  • Prev by Date: Re: XML to NSDictionary
  • Next by Date: Re: Cocoa-dev Digest, Vol 3, Issue 1339
  • Previous by thread: [solved]: Accessing structure member NSDate in NSTableView
  • Next by thread: Re: Accessing structure member NSDate in NSTableView
  • Index(es):
    • Date
    • Thread