*You answered the question "Expected'; 'at end of declaration list error cannot be resolved" which I posted before, and after correcting it, a new error occurred, so I edited the question. 内容
Objective-C cannot resolve the Collection element of type 'void' is not an Objective-Cobject error.
This is NSAray_lines=@[@"A", @"B", @"C", nil ]
I would appreciate it if you could tell me the cause.
#import "ThirdViewController.h"
@ interfaceThirdViewController()
@end
constintChangeCheckCell=1;
NSMutableArray* checkboxArray;
NSArray*_lines=@[@"A", @"B", @"C", nil ];
@implementationThirdViewController{
}
- (void) viewDidLoad{
superviewDidLoad;
The underlying problem is
NSArray*_lines=@[@"A", @"B", @"C", nil ];
The last semicolon of is missing.However, the location of the declaration and initialization of the variables is not good, so the code you want to write is probably as follows:
#import "ThirdViewController.h"
@ interfaceThirdViewController()
@end
constintChangeCheckCell=1;
NSMutableArray* checkboxArray;
NSArray*_lines=@[@"A", @"B", @"C", nil ];
@implementation ThirdViewController
- (void) viewDidLoad{
superviewDidLoad;
You cannot declare variables that are not inside a function between @implementation
and @end
.
ThirdViewController
If you want to declare a variable that is visible only in ThirdViewController.m
that is not a member of the class, you should write it outside @implementation
.
Also, if Corrected questions The checkboxArray
and _lines
are members of the class, the variable declaration should be done between @interface
and @end
in ThirdViewController.h
to initialize the variable with viewDidLoad>.
{}
after the @implementationThirdViewController
is unnecessary.
910 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
581 PHP ssh2_scp_send fails to send files as intended
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
571 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.