Today's Menu  Portugal
journal and plan nutrition
Instance Methods | List of all members
V7UsdaFoodsTableView Class Reference

#import <V7UsdaFoodsTableView.h>

Inheritance diagram for V7UsdaFoodsTableView:
Inheritance graph
[legend]
Collaboration diagram for V7UsdaFoodsTableView:
Collaboration graph
[legend]

Instance Methods

(id) - initWithFrame:andHeader:inContainer:
 
(NSInteger) - tableView:numberOfRowsInSection: [implementation]
 
(UITableViewCell *) - tableView:cellForRowAtIndexPath: [implementation]
 
(float) - getViewHeightReqmt [implementation]
 
(void) - tableView:didSelectRowAtIndexPath: [implementation]
 
- Instance Methods inherited from Z7EmpaneledTableView
(id) - initWithFrame:
 
(void) - setViewForHead:
 
(void) - spaceForSectionHead:
 
(void) - measureForSectionHead:
 
(void) - setViewForTail:
 

Detailed Description

Definition at line 12 of file V7UsdaFoodsTableView.h.

Method Documentation

◆ getViewHeightReqmt()

- (float) getViewHeightReqmt
implementation

Reimplemented from Z7EmpaneledTableView.

Definition at line 74 of file V7UsdaFoodsTableView.m.

75 {
76  NSArray<NSDictionary *> *foodEntries = [dataDelegate retrieveFoodEntries];
77  NSInteger nFoods = [foodEntries count];
78 
79  float ret = [super getViewHeightReqmt] + nFoods * 42.0;
80  NSLog(@"V7UsdaFoodsTableView.getViewHeightReqmt: ret: %3.2f", ret);
81  return ret;
82 }

◆ initWithFrame:andHeader:inContainer:()

- (id) initWithFrame: (CGRect)  frame
andHeader: (UIView *)  headerView
inContainer: (id<V7UsdaFoodsTableDelegate>)  container 
Initial value:
{
id<V7UsdaFoodsTableDelegate> dataDelegate

Definition at line 16 of file V7UsdaFoodsTableView.m.

16  :(CGRect)frame
17  andHeader:(UIView *)headerView
18  inContainer:(id<V7UsdaFoodsTableDelegate>) container
19 {
20  NSLog(@"Z7UsdaFoodsTableView.init");
21 
22  self = [super initWithFrame:frame];
23  [self setTableHeaderView:headerView];
24  [self setBackgroundColor:[[Z5DataController sharedInstance] wheatColor]];
25  self.dataSource = self;
26 
27  dataDelegate = container;
28 
29 // mDateFormatter = [[NSDateFormatter alloc] init];
30 // [mDateFormatter setTimeStyle:NSDateFormatterNoStyle];
31 // [mDateFormatter setDateStyle:NSDateFormatterMediumStyle];
32 
33  return self;
34 }
instancetype sharedInstance()
Singleton interface to both core and remote data sources.
UIView< Z6ContainedView > * headerView

◆ tableView:cellForRowAtIndexPath:()

- (UITableViewCell *) tableView: (UITableView *)  tableView
cellForRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 44 of file V7UsdaFoodsTableView.m.

44  :(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
45 {
46  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"todays-menu"];
47  NSLog(@"V7UsdaFoodsTableView.cellForRow: cell: %@", cell);
48  if (cell == nil) {
49  cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"todays-menu"];
50 
51  cell.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
52 
53  CGRect contentRect = [cell.contentView frame];
54  CGRect fetchPublishButton1Frame = CGRectMake(contentRect.size.width - 86.0f, 5.0, 34.0f, contentRect.size.height - 10);
55  UIButton *pushMe = [[UIButton alloc] initWithFrame:fetchPublishButton1Frame];
56  [pushMe setTitle:@"GO" forState:UIControlStateApplication];
57 
58  [cell.contentView addSubview:pushMe];
59  }
60 
61  NSArray<NSDictionary *> *foodEntries = [dataDelegate retrieveFoodEntries];
62  NSInteger nMesgs = [foodEntries count];
63 
64  if (nMesgs > [indexPath row]) {
65  NSDictionary *foodForCell = [foodEntries objectAtIndex:[indexPath row]];
66  NSString *caption = [foodForCell objectForKey:@"name"];
67  [Z5DataController labelizeCell:cell withText:caption inColor:[UIColor lightGrayColor] andDetail:@"more"];
68  }
69 
70  return cell;
71 
72 }
Singleton interface to both core and remote data sources.
void labelizeCell:withText:inColor:andDetail:(UITableViewCell *targCell, [withText] NSString *txt, [inColor] UIColor *color, [andDetail] NSString *detailTxt)

◆ tableView:didSelectRowAtIndexPath:()

- (void) tableView: (UITableView *)  tableView
didSelectRowAtIndexPath: (NSIndexPath *)  indexPath 
implementation

Definition at line 84 of file V7UsdaFoodsTableView.m.

84  :(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
85  // int row = (int)[indexPath row];
86 
87  /*
88  Z5EmailDataController *eMailCntrlr = [[[Z5DataController sharedInstance] remoteDataController] emailDataController];
89 
90  _focusEmailMsg = [[dataDelegate retrieveEmailMessages] objectAtIndex:[indexPath row]];
91  NSLog(@"V7UsdaFoodsTableView.tableView:didSelectRowAtIndexPath: focusEmail: bodytext: %@ date: %@ name: %@ randomkey: %@ remoteUniqueId: %@ uid: %@", [_focusEmailMsg bodytext], [_focusEmailMsg date], [_focusEmailMsg name], [_focusEmailMsg randomkey], [_focusEmailMsg remoteUniqueIID], [_focusEmailMsg uid]);
92 
93  NSString *caption = [_focusEmailMsg name];
94 
95  NSLog(@"V7UsdaFoodsTableView.tableView:didSelectRowAtIndexPath: row: %d caption: %@", row, caption);
96 
97  NSInteger focusEmailMsgUid = [_focusEmailMsg.uid integerValue];
98 
99  if ([_focusEmailMsg randomkey]) {
100  NSData *mphoto = [_focusEmailMsg photo];
101  UIImage *mPhotoImage = [UIImage imageWithData:_focusEmailMsg.photo];
102  [dataDelegate updateHTML:[_focusEmailMsg bodytext]];
103  } else {
104  [eMailCntrlr retrieveMessageStructure:focusEmailMsgUid fromFolder:@"INBOX"];
105  [eMailCntrlr retrieveTotalMessageHTML:focusEmailMsgUid fromFolder:@"INBOX" toDelegate:dataDelegate];
106  }
107 
108  [self showFoot:YES];
109  [self reloadData];
110  [self setNeedsDisplay];
111  [self scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
112  */
113 }

◆ tableView:numberOfRowsInSection:()

- (NSInteger) tableView: (UITableView *)  tableView
numberOfRowsInSection: (NSInteger)  section 
implementation

Definition at line 37 of file V7UsdaFoodsTableView.m.

37  :(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
38 {
39  NSArray<NSDictionary *> *foodEntries = [dataDelegate retrieveFoodEntries];
40  NSInteger nMesgs = [foodEntries count];
41  return nMesgs;
42 }

The documentation for this class was generated from the following files: