I am using a library called "SQLClient", located here: https://github.com/martinrybak/SQLClient
to access my database which is located on a server. After installing the library, the pods, etc, I tried making an objective-c header file and put the example code sample into the file to test if there were no errors, but the IDE is giving me syntax errors.
Here's the example code I just put in my app:
SQLClient* client = [SQLClient sharedInstance]; //initializer element is not a compile time constant
[client connect:@"server\instance:port" username:@"user" password:@"pass" database:@"db" completion:^(BOOL success) { //expected identifier or '('
if (success) {
[client execute:@"SELECT * FROM Users" completion:^(NSArray* results) {
for (NSArray* table in results) {
for (NSDictionary* row in table) {
for (NSString* column in row) {
NSLog(@"%@=%@", column, row[column]);
}
}
}
[client disconnect];
}];
}
}]; // expected ']'
I put comments next to the lines with the errors my IDE was giving me.
here's a full list:
- initializer element is not a compile time constant
- expected identifier or '('
- expected ']'
- missing '[' at start of message send expression
Any suggestions would be appreciated