Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Easy iPad Point Of Sale Application
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="bmeylema" data-source="post: 1585702" data-attributes="member: 326925"><p>Hello everyone,</p><p></p><p>My name is Bart, from Belgium, and I'm a student who's started a business with my GF. We sell ice cream & coffee out of a vintage-renovated truck (Citroën HY).</p><p>For our business, we're looking for an iPad application, so we can keep track of our sales.</p><p></p><p>There are many Point of Sales applications available, but they are pricey and we only need the very basics.</p><p></p><p>I'm a student business engineering with Java experience, but Xcode is new for me. The app should consist of buttons for ice cream, irish coffee, espresso, ... that generates a subtotal the customer has to pay. When clicking on the paid-button, the subtotal should be cleared and the sales for ice cream, coffees, should be updated (in an other window that can be reached when clicking on a "view sales report"-button). Ideally, when clicking on the sale-buttons, a list on the right should appear with the current order (2 coffees, 3 Irish Coffees at a price of x euros for example).</p><p></p><p>For now, i'm trying to implement buttons and when clicked on, incrementing an integer value for the subtotal the client has to pay.</p><p></p><p>I'm looking at this: (with the help of Youtube)</p><p></p><p><strong>viewcontroller.h file:</strong></p><p>#import <UIKit/UIKit.h></p><p></p><p>@interface ViewController : UIViewController {</p><p> IBOutlet UILabel *subtotaalLbl;</p><p> int subtotaal;</p><p>}</p><p>- (IBAction)Eenbol;</p><p>- (IBAction)Tweebol;</p><p>- (IBAction)Driebol;</p><p>- (IBAction)Supplement;</p><p>- (IBAction)IrishCoffee;</p><p>- (IBAction)ItalianCoffee;</p><p>- (IBAction)FrenchCoffee;</p><p>- (IBAction)Koffie;</p><p>- (IBAction)Espresso;</p><p>- (IBAction)Deca;</p><p>- (IBAction)CafeGlace;</p><p>@end</p><p></p><p><strong>viewcontroller.m file:</strong></p><p>#import "ViewController.h"</p><p></p><p>@interface ViewController ()</p><p></p><p>@end</p><p></p><p>@implementation ViewController</p><p></p><p>- (void)viewDidLoad</p><p>{</p><p> [super viewDidLoad];</p><p> subtotaal = 0;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p> </p><p> // Do any additional setup after loading the view, typically from a nib.</p><p>}</p><p>- (IBAction)Eenbol</p><p>{</p><p> subtotaal += 1.5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)Tweebol</p><p>{</p><p> subtotaal += 2.5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)Driebol</p><p>{</p><p> subtotaal += 3.5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)Supplement</p><p>{</p><p> subtotaal += 0.5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)Koffie</p><p>{</p><p> subtotaal += 2;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)Espresso</p><p>{</p><p> subtotaal += 2;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)Deca</p><p>{</p><p> subtotaal += 3.5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)IrishCoffee</p><p>{</p><p> subtotaal += 5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)ItalianCoffee</p><p>{</p><p> subtotaal += 5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)FrenchCoffee</p><p>{</p><p> subtotaal += 5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (IBAction)CafeGlace</p><p>{</p><p> subtotaal += 3.5;</p><p> [subtotaalLbl setText: [NSString stringWithFormat<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />"%d", subtotaal]];</p><p>}</p><p></p><p>- (void)didReceiveMemoryWarning</p><p>{</p><p> [super didReceiveMemoryWarning];</p><p> // Dispose of any resources that can be recreated.</p><p>}</p><p>@end</p><p></p><p></p><p>As I interpret this, I have declared buttons, an integer value and told the program to increment this integer value when clicked on these buttons. I created the buttons and label in the main storyboard file and linked them with the corresponding IBActions.</p><p></p><p>Still, I got this error:</p><p></p><p>2014-05-31 21:41:01.885 app kmk[745:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8d9d210> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key label.'</p><p>***</p><p></p><p>What am I doing wrong? Also, a link to useful websites, extra information is always handy! Thank you in advance.</p><p></p><p>Bart Meylemans</p></blockquote><p></p>
[QUOTE="bmeylema, post: 1585702, member: 326925"] Hello everyone, My name is Bart, from Belgium, and I'm a student who's started a business with my GF. We sell ice cream & coffee out of a vintage-renovated truck (Citroën HY). For our business, we're looking for an iPad application, so we can keep track of our sales. There are many Point of Sales applications available, but they are pricey and we only need the very basics. I'm a student business engineering with Java experience, but Xcode is new for me. The app should consist of buttons for ice cream, irish coffee, espresso, ... that generates a subtotal the customer has to pay. When clicking on the paid-button, the subtotal should be cleared and the sales for ice cream, coffees, should be updated (in an other window that can be reached when clicking on a "view sales report"-button). Ideally, when clicking on the sale-buttons, a list on the right should appear with the current order (2 coffees, 3 Irish Coffees at a price of x euros for example). For now, i'm trying to implement buttons and when clicked on, incrementing an integer value for the subtotal the client has to pay. I'm looking at this: (with the help of Youtube) [B]viewcontroller.h file:[/B] #import <UIKit/UIKit.h> @interface ViewController : UIViewController { IBOutlet UILabel *subtotaalLbl; int subtotaal; } - (IBAction)Eenbol; - (IBAction)Tweebol; - (IBAction)Driebol; - (IBAction)Supplement; - (IBAction)IrishCoffee; - (IBAction)ItalianCoffee; - (IBAction)FrenchCoffee; - (IBAction)Koffie; - (IBAction)Espresso; - (IBAction)Deca; - (IBAction)CafeGlace; @end [B]viewcontroller.m file:[/B] #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; subtotaal = 0; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; // Do any additional setup after loading the view, typically from a nib. } - (IBAction)Eenbol { subtotaal += 1.5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)Tweebol { subtotaal += 2.5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)Driebol { subtotaal += 3.5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)Supplement { subtotaal += 0.5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)Koffie { subtotaal += 2; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)Espresso { subtotaal += 2; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)Deca { subtotaal += 3.5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)IrishCoffee { subtotaal += 5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)ItalianCoffee { subtotaal += 5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)FrenchCoffee { subtotaal += 5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (IBAction)CafeGlace { subtotaal += 3.5; [subtotaalLbl setText: [NSString stringWithFormat:@"%d", subtotaal]]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end As I interpret this, I have declared buttons, an integer value and told the program to increment this integer value when clicked on these buttons. I created the buttons and label in the main storyboard file and linked them with the corresponding IBActions. Still, I got this error: 2014-05-31 21:41:01.885 app kmk[745:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8d9d210> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key label.' *** What am I doing wrong? Also, a link to useful websites, extra information is always handy! Thank you in advance. Bart Meylemans [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Easy iPad Point Of Sale Application
Top