开发者

EXC_BAD using own struct as return value

i am using the following struct as a return value of a method:

typedef开发者_如何学C struct {
CLLocationCoordinate2D topLeftCorner;
CLLocationCoordinate2D bottomRightCorner;
} LCMapBoundings;

The following method crashes instantly:

-(LCMapBoundings)calculate {
NSLog(@"test");
}

But that one works:

-(LCMapBoundings*)calculate {
NSLog(@"test");
}

Why is that? What am i messing up when using the first method?


Perhaps it's crashing because you don't return a value in your method? That's undefined behaviour.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜