myData = [NSData dataWithBytes:(void*)pEvent length:sizeof(stRs232Timer*)];
[m_cAppIdMap setObject:myData forKey:[NSNumber numberWithUnsignedShort:wTimerId]];
if (pEvent->uExpirationTime < m_cPendingEventList->uExpirationTime) {
}
[m_cPendingEventList addObject:myData];
pEvent is a structure here.I’m trying to compare the expiration time with the expiration time field of the structure stored in the NSMutableArray m_cPendingEventList.
How to do that.The above if condition fails and is showing error.
Error:’struct NSMutableArray’ has no member named ‘uExpirationTime’
pEvent is a pointer to the structure containing uExpirationTime,uPeriod,etc as fields.
You should cast your
pEventtostRs232Timer, provided that everything else is correct with your code (I am guessing this from this:length:sizeof(stRs232Timer*))in last line I added the cast…
if this does not work, can you provide the declaration of
pEvent?