Recent

Author Topic: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]  (Read 10442 times)

simonsayz

  • New Member
  • *
  • Posts: 27

Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]

Basic Tutorial for Clean Installation

Ref. http://blog.naver.com/simonsayz/220305479793

Always Thanks.

Simon,Choi

CCRDude

  • Hero Member
  • *****
  • Posts: 502
Many thanks for your continuos work, your previous tutorials were already the best thing that could happen to my current project. I'll surely follow this as well asap :)

jwdietrich

  • Hero Member
  • *****
  • Posts: 1036
    • formatio reticularis
Great! Your tutorials are very useful.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.0.6 | FPC 3.0.4 | PPC, Intel, ARM | macOS, Windows, Linux

CCRDude

  • Hero Member
  • *****
  • Posts: 502
Did follow the tutorial now. Aftermath is taking more time than those actual steps, thanks again for making it so easy :)

Don't take the following issues personal, I just wanted to share my experience in case others who follow your tutorial come across the same...

Issue: (tutorial was updates, thanks!) The tutorial says to check out revision 30263, but doesn't specify the checkout parameters to do so. Might want to include that, so that everyone can easily follow up with copy'n'paste.

Issue: Speaking about copy'n'paste: to avoid non-visible text in the clipboard, which confuses the terminal, access the page with JavaScript disabled. Also, do not double-click lines to copy the whole line - sometimes there are spaces, or worse, other invisible characters, at line beginning, which will lead to a command not being accepted.

Issue: Can't test this with iPhone 5 Simulator or lower due to just one (64 bit) simulator architecture. Would be great if future tutorials would include 32 bit simulator for emulation on old devices.

Issue: (solution in posts below) This code no longer compiles due to invalid number of parameters:
Code: [Select]
   Result := UIActionSheet.alloc.initWithTitle_delegate_cancelButtonTitle_destructiveButtonTitle_otherButtonTitles(nil, nil,
      Utf8StrToNSStr('Cancel'),
      Utf8StrToNSStr('Delete Product'),
      Utf8StrToNSStr('Show Files in Product'),
      nil);
This must have been an issue with iOS_Controls.pas as well, since Constructor TiOSAlertView.CreateWithTitle has been adjusted accordingly and is now kind of broken there.
Kind of my most serious problem, since I've been using this to display three options. Will investigate this later.

Issue: Table cell selection still not implemented in iOS_Controls, while being so easy:
Code: [Select]
Procedure TUITableViewEvent_.tableView_didSelectRowAtIndexPath(tableView: UITableView; indexPath: NSIndexPath);
 begin
   if Assigned(OnSelect) then begin // pk
      OnSelect(nil);
   end;

Issue: Example project hangs at black screen on my iPhone 5 (had to reduce dist platform from 8.2 to 8.1). Doesn't matter that much, mine compiles and runs fine ;)

Will try to downgrade / make 7.1 SDK available on my machine now, since I want to be backwards compatible really.
« Last Edit: March 27, 2015, 09:54:45 am by CCRDude »

simonsayz

  • New Member
  • *
  • Posts: 27
Wow   :D
Great thanks to CCRDude

I will fix the issues in library within this week,
and reply the new state.

Best Regards
Simon,Choi

CCRDude

  • Hero Member
  • *****
  • Posts: 502
Found the UIActionSheet issue:
Code: [Select]
// iOS 6.1 SDK iPhoneAll headers (working):
function initWithTitle_delegate_cancelButtonTitle_destructiveButtonTitle_otherButtonTitles (title: NSString; delegate: UIActionSheetDelegateProtocol; cancelButtonTitle: NSString; destructiveButtonTitle: NSString; otherButtonTitles: NSString): id; varargs; message 'initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:';
// iOS 8.0 SDK iPhoneAll headers (not working):
function initWithTitle_delegate_cancelButtonTitle_destructiveButtonTitle_otherButtonTitles (title: NSString; delegate: UIActionSheetDelegateProtocol; cancelButtonTitle: NSString; destructiveButtonTitle: NSString; otherButtonTitles: NSString): instancetype; message 'initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:';

Notice the varargs in the old headers, which is missing in the new. So by updating UIActionSheet to state
Code: [Select]
function initWithTitle_delegate_cancelButtonTitle_destructiveButtonTitle_otherButtonTitles (title: NSString; delegate: UIActionSheetDelegateProtocol; cancelButtonTitle: NSString; destructiveButtonTitle: NSString; otherButtonTitles: NSString): instancetype; varargs; message 'initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:';and recompiling iPhoneAll (step 7 of the tutorial), I was able to compile my application with a custom number of buttons.

Also proceeded with the i386 simulator (steps 5.3.1 and 7), had to reference 6.1 SDK, the most current one threw the dyld error:
Code: [Select]
export IOS_BASE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk
export BIN_BASE=${IOS_BASE}/usr/bin
sudo make FPC=/usr/local/lib/fpc/3.1.1/ppc386 OPT="-ap" CPU_TARGET=i386 OS_TARGET=iphonesim CROSSOPT="-FD${BIN_BASE} -XR${IOS_BASE}" all
sudo make crossinstall CPU_TARGET=i386 OS_TARGET=iphonesim
and
Code: [Select]
sudo /usr/local/lib/fpc/3.1.1/ppcross386 -Tiphonesim -dIPHONEALL iPhoneAll.pas
sudo mkdir -p    /Developer/FPC/iOS8.0/i386-iphonesim/
sudo mv  *.o      /Developer/FPC/iOS8.0/i386-iphonesim/
sudo mv  *.ppu  /Developer/FPC/iOS8.0/i386-iphonesim/

Compiling iPhoneAll for the i386 simulator works, now need to adjust Run Script of project, which needs me looking deeper into bash.
« Last Edit: March 27, 2015, 01:00:30 pm by CCRDude »

aidv

  • Full Member
  • ***
  • Posts: 173
I followed the instructions but now I cant download the example files from the article to see if it works.

Can I find examplefiles somewhere else?


CCRDude

  • Hero Member
  • *****
  • Posts: 502
They worked last time I tried. If not, check the HTML for the link, or older tutorials :)

miko

  • Newbie
  • Posts: 1
hello,
i'm an old developer from Delphi for windows, new to MAC and lazarus, following the tutorial, nothing works :('  did someone have an easier doc helping me please ?

simonsayz

  • New Member
  • *
  • Posts: 27
@aidv

If you can't download the examples in my blog.

It can help for you
DropBox - ios example files

https://www.dropbox.com/sh/yj82hb596kzar5j/AADQfzfXKTdGW0651vjgrjUia?dl=0



simon

  • New member
  • *
  • Posts: 6
Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
« Reply #10 on: September 03, 2015, 05:01:31 pm »
Hi -

I'm new to FreePascal and would like to use it for iOS and Android development.

I've successfully created the necessary cross-compiler flavours of FPC by following the instructions from http://blog.naver.com/simonsayz/220305479793 but have run into a problem.

I'm trying to use iOS 8.4. I'm at step 7.1:

Meteor:iPhoneAll simon$ 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/09/03] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Darwin for ARM
Compiling iPhoneAll.pas
Compiling CFNetwork.pas
Compiling CoreFoundation.pas
CFBase.inc(260,3) Fatal: Syntax error, "identifier" expected but "CONST" found
Fatal: Compilation aborted

Line 260 in CFBase.inc reads:

const struct CF_BRIDGED_TYPE = function (CFNullGetTypeID(void: NSNull) __CFNull* CFNullRef;CF_EXPORTCFTypeID): ; cdecl;

Any ideas what the issue may be?

many thanks

Simon

herux

  • Full Member
  • ***
  • Posts: 100
Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
« Reply #11 on: September 23, 2015, 10:04:57 am »
I will leave my trail here .. will follow the tutorial this night,
thanks to simonsayz