Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kapthehat

macrumors member
Original poster
Jul 1, 2013
51
0
I am working through Apress beginning IOS Development and am encountering some basic errors - which I can't seem to get my head around. These all relate to the project in chapter 6.0.

I have attached some screenshots - which show the errors and code. All help gratefully appreciated. Thanks

regards

Kaps
 

Attachments

  • Screen Shot 2013-08-06 at 08.30.39.png
    Screen Shot 2013-08-06 at 08.30.39.png
    470.8 KB · Views: 119
  • Screen Shot 2013-08-06 at 08.49.43.png
    Screen Shot 2013-08-06 at 08.49.43.png
    571.4 KB · Views: 94
Last edited:
As above - the .h (header file) should never have an @implimentation in it. It is used for declaring properties and methods. No "executable code" should ever go in there.

Think of the files like this:

The .h file:

This is like the index of a book - likes what the class is about - and it's properties

The .m
Is like a workshop manual - tells you how to do a set of instructions and the "working code" behind it.

Examples:

Code:
header file.h 


#import <UIKit/UIKit.h>

@interface SomeClass : SomeSubClass

@property (copy, nonatomic) IBOutlet UIButton *fooButton; 
@end

So now we know that this class has a UIButton named Foo - what does this button actually do?

That's where our implementation file comes into play ...

Code:
#import "SomeClass.h"

@implementation ViewController

- (UIButton*)fooButton
{
   //Puts up an alert view, saying hello 

  //Code in here to make that happen

}


@end


I hope this clears up for issues a little and makes it clearer.
 
Thank you. I now have one error - stating that @end is missing in "BIDBlueViewController". See attached screenshots.
 
Thank you. I now have one error - stating that @end is missing in "BIDBlueViewController". See attached screenshots.

Right at the bottom of the class should have that - screen shot does't show the bottom of that class.


Just make sure

@end

is the last line of code in that class.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.