Note that there are some explanatory texts on larger screens.

plurals
  1. POStumped: Cannot use class definition
    primarykey
    data
    text
    <p>I have a Owners class defined that is used just fine in existing classes.</p> <p>I tried to add another class, and no matter what I do (deleted, recreated new class, copied other class files over and renamed, cleaned all targets, howled at the moon), I cannot use this particular class in any new files I create.</p> <p>The class is simple with a singleton definition of an array.</p> <p>Here it is in use in another class (just fine):</p> <pre><code>#import "OwnersSchema.h" #import "Owners.h" #import "Constants.h" @implementation OwnersViewController @synthesize mid,imageStore; - (OwnersSchema *)OwnersForIndexPath:(NSIndexPath *)indexPath { return [[Owners sharedOwners].ownersArray objectAtIndex:indexPath.row]; } </code></pre> <p>So I make an exact copy of the above header and make files, just rename interface, etc. and add the same exact code, and it claims Owners is undeclared: First use in function.</p> <p>I can add other class definitions to the new file and it sees them just fine.</p> <p>Here is the Owners class:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "URLConnection.h" @class OwnersSchema; @interface Owners : NSObject &lt;URLCacheConnectionDelegate&gt; { NSMutableArray *ownersArray; NSString *lastUpdated; NSString *url; NSString *dbpath; } @property (nonatomic,retain) NSString *dbpath; @property (nonatomic,retain) NSMutableArray *ownersArray; @property (nonatomic,retain) NSString *lastUpdated; @property (nonatomic,retain) NSString *url; -(void)saveOwnersArray; + (Owners *)sharedOwners; @end </code></pre> <p>I don't get it. I just want to create another viewcontroller. Is there some limitation on the number of files or class inclusions (actually, I use this Owners class in only a few places). And why does it work everywhere else except for the new class I'm trying to create? </p>
    singulars
    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.
    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