ERROR: Cannot declare variable inside @interface or @protocol

I clicked Modernize Project and then I got some compile errors. (I Did take a snapshot)

The error is: Cannot declare variable inside @interface or @protocol

Here is the code in copy and paste format.

#import <Cocoa/Cocoa.h>
#import "AJHBezierUtils.h"

@interface NSBezierPath (WBBezierPath) 

NSBezierPath        *flattenPath;

NSPointArray        points;

int                 numPoints;


+(NSBezierPath*)roundedPath:(NSRect)aRect radius2:(int)rad2;


-(NSPoint ) getLinePoints:(NSPoint )p1 p2:(NSPoint)p2  withDistance:(int )pointDistance;

- (NSPoint *)pointsFromPathWithDistance:(int)distance numberOfPoints:(int *)numberOfPoints;


- (float)distanceBetweenPoint:(NSPoint)a andPoint:(NSPoint)b;

- (int)numberOfPoints;

Answers


You need braces for interface ivars:

@interface NSBezierPath (WBBezierPath)
{
  NSBezierPath        *flattenPath;
  NSPointArray        points;
  int                 numPoints;
}

However, because you are defining a category, ivars are not allowed. You need to use properties instead:

@interface NSBezierPath (WBBezierPath)

@property (nonatomic, strong) NSBezierPath *flattenPath;

/* Methods */

@end

Need Your Help

Laravel 5 setting route parameter from middleware

laravel parameters laravel-5 middleware slug

The problem: I'd like to resolve slugs, if a slug has been used as a route parameter instead of an id.