Lazarus

Programming => Operating Systems => iPhone/iPad => Topic started by: aidv on May 19, 2015, 01:52:26 pm

Title: iOS development with Lazarus
Post by: aidv on May 19, 2015, 01:52:26 pm
Hi all!

I am trying to setup all bits and pieces to get my iOS dev up and running but it fails.

I am using a MacBook Air 13" with Yosemite 10.10.3 and XCode 6.

I have followed the instructions found here: http://blog.naver.com/simonsayz/220305479793

But when I get to the point to install the crosscompiler and it asks me to enter the path of the SDK,
it doesnt work no matter what path I give it.

Does anyone have an up-to-date instruction on how to get started with iOS development with Lazarus?
Title: Re: iOS development with Lazarus
Post by: aidv on May 21, 2015, 10:00:19 pm
Anyone?
Title: Re: iOS development with Lazarus
Post by: aidv on May 22, 2015, 02:24:26 am
Please anyone, XCode is a torture.

In pascal we can combine two strings simply by writing

myString := strA + strB;

in XCode the only way to do it apparently is by writing

self.myString = [NSString stringWithFormat:@"%@%@", strA, strB];

This community seriously needs to get a grip of this iOS dev thing,
I am willing to help, just tell me what to do.
Title: Re: iOS development with Lazarus
Post by: skalogryz on May 22, 2015, 03:42:25 am
what's the exact error you're getting when building (installing) the cross-compiler?

Are you sure you're using Xcode 6.2 and not Xcode 6.0? If you're using Xcode 6.0 you've to upgrade (it's free and easy). iOS 8.2 comes in Xcode 6.2 only.
Title: Re: iOS development with Lazarus
Post by: aidv on May 22, 2015, 02:26:50 pm
Right now I'm stuck at

Code: [Select]
sudo /usr/local/lib/fpc/3.1.1/ppcrossarm -Cparmv7 -Cfvfpv3 -dIPHONEALL  -FD/Applications/Xcode.app/Contents/Developer iPhoneAll.pas
Free Pascal Compiler version 3.1.1 [2015/05/22] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Darwin for ARM
Compiling iPhoneAll.pas
CAMetalLayer.inc(12,94) Error: Forward declaration "MTLDrawableProtocol" must be resolved before a class can conform to or implement it
NSFileWrapper.inc(29,19) Error: No matching implementation for interface method "initWithCoder(NSCoder):^objc_object;" found
CAMetalLayer.inc(23,12) Error: Identifier not found "_CAMetalLayerPrivatePtr"
CAMetalLayer.inc(23,35) Error: Error in type definition
CAMetalLayer.inc(27,54) Error: Identifier not found "MTLPixelFormat"
CAMetalLayer.inc(28,41) Error: Identifier not found "MTLPixelFormat"
UIActionSheet.inc(26,14) Fatal: Syntax error, "identifier" expected but "FUNCTION" found
Fatal: Compilation aborted

The code for CAMetalLayer.inc(12,94)

looks like this:
 
Code: [Select]
{$ifdef PROTOCOLS}

type
  CAMetalDrawableProtocol = objcprotocol external name 'CAMetalDrawable' (MTLDrawableProtocol)
    function texture: MTLTextureProtocol; message 'texture';
    function layer: CAMetalLayer; message 'layer';
  end;
{$endif}

I am using Version 6.3.1 (6D1002) and it has the XCode 8.3 SDK.

Any hints?

Title: Re: iOS development with Lazarus
Post by: aidv on May 22, 2015, 03:02:15 pm
I think I solved that particular problem.

All I did was to add "DefinedClassesMetal" to the uses clause of the unit "iPhoneAll.pas"

I commented out the following part in CAMetalLayer.inc

Code: [Select]
{$ifdef PROTOCOLS}

{type
  CAMetalDrawableProtocol = objcprotocol external name 'CAMetalDrawable' (MTLDrawableProtocol)
    function texture: MTLTextureProtocol; message 'texture';
    function layer: CAMetalLayer; message 'layer';
  end;}
{$endif}

{$ifdef CLASSES}

I don't get the previous error any longer.
Title: Re: iOS development with Lazarus
Post by: aidv on May 22, 2015, 03:45:32 pm
Now I'm stuck at

Code: [Select]
NSFileWrapper.inc(29,19) Error: No matching implementation for interface method "initWithCoder(NSCoder):^objc_object;" found
and when looking inside NSFileWrapper.inc I only see this line:

Code: [Select]
function initWithCoder (inCoder: NSCoder): instancetype; message 'initWithCoder:'; { NS_DESIGNATED_INITIALIZER }
I don't understand where the whole "^objc_object;" comes from.

Any ideas?
Title: Re: iOS development with Lazarus
Post by: skalogryz on May 22, 2015, 04:43:29 pm
initWithCoder comes from a protocol that NSFileWrapper implemented.
The protocol name is NSCoding. So you might want to check its declaration as well.

How is NSFileWrapper defined for you?
Title: Re: iOS development with Lazarus
Post by: aidv on May 22, 2015, 06:22:08 pm
Alight. There are so many .inc and .pas files that contain NSCoding so I don't know where to begin.

Could you guide me on how to check its decleration.

Also, what do you mean with how the NSFIleWrapper is defined for me?
Title: Re: iOS development with Lazarus
Post by: CCRDude on May 26, 2015, 08:03:00 am
Did you use the pre-compiled headers or did you use the header parser? I remember issues with the parser the last times I tried.
TinyPortal © 2005-2018