Note that there are some explanatory texts on larger screens.

plurals
  1. PO[iOS][Objective-C] Expected type
    primarykey
    data
    text
    <p>I have a Problem in one of my Objective-C classes.</p> <p>Xcode said that there is a Parse Issue in line 20.</p> <pre><code>+ (Boolean)hasOverlay:(KnownPoints*)points byPoint:(CGPoint)p; </code></pre> <p>KnownPoints is a self written Class. Xcode displays that the error is at the part '(KnownPoints*)points.</p> <p>The answer of an other similar topic to add this Codeline:</p> <pre><code>@class KnownPoints </code></pre> <p>does not work.</p> <p>The class is called in a calculation class which makes latitudes and longitudes to x and y coordiantes form a view.</p> <p>Here the Code: (CalcMakerPos.h)</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #import &lt;MapKit/MapKit.h&gt; #import "Journey.h" #import "CoordRect.h" #import "KnownPoints.h" @interface CalcMakerPos : NSObject + (CGPoint)calcPosFor: (CLLocationCoordinate2D)coord WithDataFrom: (CoordRect*)rect AtView: (UIView*)view; + (Boolean)hasOverlay:(KnownPoints*)points byPoint:(CGPoint)p; @end </code></pre> <p>CalcMakerPos.m</p> <pre><code>#import "CalcMakerPos.h" #import "MinMaxCoords.h" #import "Journey.h" #import "KnownPoints.h" @implementation CalcMakerPos #pragma mark Calculate GeoCoords zu Pixeln + (CGPoint)calcPosFor: (CLLocationCoordinate2D)coord WithDataFrom: (CoordRect*)rect AtView: (UIView*)view{ double maxLat = [rect maxLat]; double minLat = [rect minLat]; double maxLon = [rect maxLon]; double minLon = [rect minLon]; int x = (int)((coord.longitude - minLon) / (maxLon - minLon) * view.frame.size.width); int y = (int)((coord.latitude - minLat) / (maxLat - minLat) * view.frame.size.height); NSLog(@"Point(%d, %d)", x,y); return CGPointMake(x, y); } #pragma mark check whether point is free + (Boolean)hasOverlay:(KnownPoints*)points byPoint:(CGPoint)p{ BOOL isOverLay = false; return isOverLay; } @end </code></pre> <p>I hope you can help me.</p> <p>Greetings form Germany</p> <p>Robybyte</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload