Error: Inherited methods can only be overridden in Objective-C and Java, add "override" (inherited method defined in NSURLConnectionDelegateCategory
Error: <stdin>:219:1: error: invalid symbol redefinition
Error: "-TmsMacRequestDeletegate connection::]":
Error: ^
The reason is that the Apple API does not give different names...Apple API gives different names. As a matter of fact, it HAS to.
I like this naming better of course :) but I feel I am left a bit guessing on the innerworkings of FPC/ObjectivePascal.
procedure foo(a: Integer); overload;
procedure foo(d: double); overload;
It's perfectly normal way of overloading in pascal. (behind the scenes, the compiler will distinguish between to procedures, by giving them a symbol names, like:void foo:(int) a
However, the name will not contain type information, but also a presence of an parameter.void foo:(double) a
will fail (or get runtime confused), as the selector is identical "foo:"- (void)connection:(NSURLConnection *)connection
didReceiveData:(NSData *)data;
selectors is "connection:didReceiveData:". [obj connection: conn didReceiveData: data]
unlike similar call in pascal (type out the name first and then entire list of parameters) connection_didReceiveData(conn, data);
procedure connection(ANSUC: NSURLConnection;
didSendBodyData: Integer;
totalBytesWritten: Integer;
totalBytesExpectedToWrite: Integer
)
into a selected, for the following reasons:procedure dataBytesWritten(ANSUC: NSURLConnection;
bytesWritten: Integer;
totalBytesWritten: Integer;
totalBytesExpectedToWrite: Integer
); message 'connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:'
instead of procedure connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite(ANSUC: NSURLConnection;
bytesWritten: Integer;
totalBytesWritten: Integer;
totalBytesExpectedToWrite: Integer
); message 'connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:'
or naming everything "connection"Can I ask what you would translate
the issue is with Cocoa headers in FPC.QuoteError: Inherited methods can only be overridden in Objective-C and Java, add "override" (inherited method defined in NSURLConnectionDelegateCategory
This needs to be reported to FPC team.
One quick question
Do you know if
urlConnection.scheduleInRunLoop_forMode(NSRunLoop.mainRunLoop, NSDefaultRunLoopMode); urlConnection.start
will work in LCL-Cooca?
Class instances are implicit pointers
Description: In (Delphi-style) Object Pascal, all class instance variables are implicit pointers, and they are also implicitly dereferenced. In Objective-C, class instances are explicitly declared as being "a pointer to a class instance", e.g. NSObject *obj; and need to be explicitly dereferenced when accessing instance variables (although this seldom happens, since most of the time accessors or properties are used). We have chosen to follow the Object Pascal way for Objective-Pascal to make it more familiar for people coming from Object Pascal, and because (given the identifier naming constraints outlined below) using a non-dereferenced form of Objective-C class would hardly ever be wanted in Pascal.
What to do: Do not use any explicit indirection when dealing with Objective-Pascal class instances.
I figured out what was suddenly causing problems. Own fault