BOOL retc = NO;
@try {
[self clear];
// - findByCriteria returns an NSArray object
// - findFirstByCriteria returns a dbmenulist object
// - You MUST use findFirstByCriteria here:
self.listinfo = (dbmenulist *)[[dbmenulist class] findFirstByCriteria: MENULIST_SQLQUERY(idmenulist)];
// - If you want to be sure test the returned instance:
if( self.listinfo && [self.listinfo isKindOfClass:[dbmenulist class]] ){
[self fillItemsFor: idmenulist];
retc = YES;
}
}
@catch (NSException * e) {
NSLOG(@"loadFor: exception: %@", e.reason);
}
return retc;
@try {
[self clear];
// - findByCriteria returns an NSArray object
// - findFirstByCriteria returns a dbmenulist object
// - You MUST use findFirstByCriteria here:
self.listinfo = (dbmenulist *)[[dbmenulist class] findFirstByCriteria: MENULIST_SQLQUERY(idmenulist)];
// - If you want to be sure test the returned instance:
if( self.listinfo && [self.listinfo isKindOfClass:[dbmenulist class]] ){
[self fillItemsFor: idmenulist];
retc = YES;
}
}
@catch (NSException * e) {
NSLOG(@"loadFor: exception: %@", e.reason);
}
return retc;
@try {
[self clear];
// There is only one record that matches the search criteria
self.listinfo = (dbmenulist *)[[dbmenulist class] findByCriteria: MENULIST_SQLQUERY(idmenulist)];
if( self.listinfo ){
[self fillItemsFor: idmenulist];
retc = YES;
}
}
@catch (NSException * e) {
NSLOG(@"loadFor: exception: %@", e.reason);
}
return retc;