I don't know why this sub can't be compiled, please help, thanks.
The log:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_icsub.m:2854:51: error: expected a type
- (BOOL)setlastmodifiedtime: (NSString*) target NSLong) dt {
^
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_icsub.m:2867:3: warning: passing 'const void *' to parameter of type 'void * _Nullable' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
data.bytes,
^~~~~~~~~~
In module 'UIKit' imported from ../../Libs/iCore.h:7:
In module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:63:75: note: passing argument to parameter 'data' here
CG_EXTERN CGContextRef __nullable CGBitmapContextCreate(void * __nullable data,
^
1 warning and 1 error generated.
B4X:
Sub icSetLastModified(Dir As String, FileName As String, DT As Long) As Boolean
Dim no As NativeObject = Me
Return no.RunMethod("setlastmodifiedtime::", Array(File.Combine(Dir, FileName), DT))
End Sub
#if objc
- (BOOL)setlastmodifiedtime: (NSString*) target :(NSLong) dt {
NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys: dt, NSFileModificationDate, NULL];
return [[NSFileManager defaultManager] setAttributes: attr ofItemAtPath: target error: NULL];
}
#end if
The log:
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_icsub.m:2854:51: error: expected a type
- (BOOL)setlastmodifiedtime: (NSString*) target NSLong) dt {
^
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_icsub.m:2867:3: warning: passing 'const void *' to parameter of type 'void * _Nullable' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
data.bytes,
^~~~~~~~~~
In module 'UIKit' imported from ../../Libs/iCore.h:7:
In module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:63:75: note: passing argument to parameter 'data' here
CG_EXTERN CGContextRef __nullable CGBitmapContextCreate(void * __nullable data,
^
1 warning and 1 error generated.