Lazarus
Programming => Operating Systems => iPhone/iPad => Topic started 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
-
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 :)
-
Great! Your tutorials are very useful.
-
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:
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:
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.
-
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
-
Found the UIActionSheet issue:
// 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
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:
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
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.
-
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?
-
They worked last time I tried. If not, check the HTML for the link, or older tutorials :)
-
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 ?
-
@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
-
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
-
I will leave my trail here .. will follow the tutorial this night,
thanks to simonsayz