FROM : Bert Torfs
DATE : Thu Dec 02 21:59:29 2004
Dear all,
following method runs OK if I call it directly from my code. When I
call it via an NSTimer however, my program crashes when getting the
arrangedObjects from the 'theStockArrayController'.
//=======Snippet start
-(void)calculateStockPrices:(NSTimer*)theTimer
{
NSArray* theCurrencyArray;
//theStockArrayController is an IBOutlet connected via Interface
builder
//to a standard arrayController. We need to loop over the array it
controls
if (theStockArrayController)
{
//This crashes if called from a timer
theCurrencyArray = [theStockArrayController arrangedObjects];
//The rest is of no importance
}
}
//=======Snippet end
The timer is created with the following statement :
theRefreshTimer = [[NSTimer
scheduledTimerWithTimeInterval:(NSTimeInterval)theRefreshRate*60
target:self
selector:@selector(calculateStockPrices:)
userInfo:NULL
repeats:YES]retain];
any idea?
Thanks a lot,
Bert
DATE : Thu Dec 02 21:59:29 2004
Dear all,
following method runs OK if I call it directly from my code. When I
call it via an NSTimer however, my program crashes when getting the
arrangedObjects from the 'theStockArrayController'.
//=======Snippet start
-(void)calculateStockPrices:(NSTimer*)theTimer
{
NSArray* theCurrencyArray;
//theStockArrayController is an IBOutlet connected via Interface
builder
//to a standard arrayController. We need to loop over the array it
controls
if (theStockArrayController)
{
//This crashes if called from a timer
theCurrencyArray = [theStockArrayController arrangedObjects];
//The rest is of no importance
}
}
//=======Snippet end
The timer is created with the following statement :
theRefreshTimer = [[NSTimer
scheduledTimerWithTimeInterval:(NSTimeInterval)theRefreshRate*60
target:self
selector:@selector(calculateStockPrices:)
userInfo:NULL
repeats:YES]retain];
any idea?
Thanks a lot,
Bert
| Related mails | Author | Date |
|---|---|---|
| Bert Torfs | Dec 2, 21:59 | |
| Bert Torfs | Dec 3, 10:10 |






Cocoa mail archive

