Lazarus

Programming => Operating Systems => iPhone/iPad => Topic started by: simonsayz on March 20, 2015, 04:26:56 pm

Title: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: simonsayz on March 20, 2015, 04:26:56 pm

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
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: CCRDude on March 20, 2015, 07:47:01 pm
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 :)
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: jwdietrich on March 20, 2015, 10:04:33 pm
Great! Your tutorials are very useful.
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: CCRDude on March 26, 2015, 12:15:05 pm
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.
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: simonsayz on March 26, 2015, 07:52:00 pm
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
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: CCRDude on March 27, 2015, 09:47:12 am
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.
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: aidv on May 17, 2015, 07:08:54 pm
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?

Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: CCRDude on May 26, 2015, 08:04:16 am
They worked last time I tried. If not, check the HTML for the link, or older tutorials :)
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: miko on June 22, 2015, 11:21:04 am
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 ?
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: simonsayz on August 03, 2015, 04:17:44 pm
@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


Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: simon 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
Title: Re: Test on [FPC 3.1.1 , OS X 10.10.2 , iOS 8.2 , XCode 6.2, 64bit,32bit]
Post by: herux on September 23, 2015, 10:04:57 am
I will leave my trail here .. will follow the tutorial this night,
thanks to simonsayz
TinyPortal © 2005-2018