Here is my code:
- (BOOL) saveSiteData {
// validate all fields
if(txtSiteID.text.length == 0 || txtSiteDesc.text.length == 0) {
[self Alert:@"Missing Site ID and/or Description" andData:@"Reqired fields"];
return NO;
}
if(txtSTA.text.length == 0 || txtElev.text.length == 0) {
[self Alert:@"Missing Initial STA and/or Elevation" andData:@"Reqired fields"];
return NO;
}
// txtSiteDesc.text = txtSiteDesc.text.re <---------- remove single quotes TODO
NSString selectCmd = [NSString stringWithFormat:@"%@,%@,%@", @"SELECT COUNT (*) FROM SiteData WHERE SITE_ID = '",
txtSiteID.text, @"'"];
return YES;
}
The error message I’m getting is: Interface type cannot be statically allocated.
Why? and how do I fix it?
This is wrong. Any Objective-C object is a pointer. So you need an asterisk: