Reputation: 14246
Is there such a list?
I'm relatively new to iOS development and I'm think it would be great to study a list of most well-known compiler bugs or gotchas.
EDIT: Today I spent too much time to understand what's going on with code like this:
in *.h
@interface I : NSObject {
..
NSSMutableArray* var; // typo, should be m_var;
}
@property (nonatomic, readonly) NSMutableArray* var;
in *.m
@implementation I
@synthesize var = m_var; // no warnings or anything
-(id) init
{
self = [super init];
if (self != nil)
{
// no warning or errors
m_var = [NSMutableArray new];
}
return self;
}
And I think it's time to learn some of the well-known Objective-C idiosyncrasies.
Upvotes: 1
Views: 2472
Reputation: 14419
Apple has its own bug tracker, but you can only see you own reports (!?)
Your best bet is then openradar... Which is limited.
EDIT: About your supposed Xcode Bug, even if that's not the question.
Remember that @synthesize
is just syntactic sugar that will generate code at compilation.
My guess is that your var property is conflicting with your var member.
I would not say that's a bug, more a predictable issue that could be integrated in clang static analysis.
Anyway, that's obviously a code typo, a human error, tools are just there to help us, or we would write assembly bytecode directly :)
Upvotes: 1
Reputation: 104065
The golden rule of debugging: it’s not compiler’s fault. Some behaviours are a bit strange, like the one you show here, but they are by design. As for the “bug” in question, the compiler can synthesize instance variables for you, without them having to be declared:
@interface Foo {}
@property(assign) float bar;
@end
@implementation Foo
@synthesize bar;
- (void) somewhere { bar = 1; }
@end
This is convenient and allows you to move private interfaces into the implementation file. Coming back to your example, you now have two instances variables, var
and m_var
, the second one acting as a storage for the var
property. It’s not exactly something to be happy about, but it makes perfect sense. (Could there be a warning that you have an instance variable that doesn’t act as a store for a property with the same name?)
As this kind of behaviour is mostly by design, you won’t find it in the Radar and would have to look for a list of common Objective-C gotchas. (This is another interesting situation.)
Upvotes: 1
Reputation:
Apple’s list of bugs is internal to Apple.
I think that Open Radar is the closest thing you’ll get to a public list of bugs related to Apple products, including Xcode. It is maintained by the community — users are encouraged to post to Open Radar the bug reports that have been submitted to Apple.
Upvotes: 2