Recent

Author Topic: Objective Pascal tutorial: iPhone and iPad  (Read 16128 times)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Objective Pascal tutorial: iPhone and iPad
« on: April 26, 2011, 11:36:07 pm »
The Objective Pascal series continues with Part 3, iOS Simulator and Xcode 4:

http://web.me.com/macpgmr/ObjP/Xcode4/ObjP_Intro.html


Thanks.

-Phil

denver

  • Jr. Member
  • **
  • Posts: 67
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #1 on: April 26, 2011, 11:40:10 pm »
Good Job !

It is very useful for me. Will try some test on iOS .

Thanks.


Andru

  • Full Member
  • ***
  • Posts: 112
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #2 on: April 27, 2011, 04:27:54 pm »
Nice! Maybe I will move to Xcode from Lazarus+Makefiles :)

laguna

  • Sr. Member
  • ****
  • Posts: 325
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #3 on: April 27, 2011, 05:49:55 pm »
Where can I find a sample project?

Thanks

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #4 on: April 27, 2011, 06:45:08 pm »
You can create a sample project in just a few seconds using the custom Pascal templates for Xcode 4. Is there something else you're looking for? If so, maybe you could describe what you'd like to see.

Thanks.

-Phil

Caronte

  • New member
  • *
  • Posts: 7
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #5 on: April 30, 2011, 08:31:44 pm »
Wow! ;)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #6 on: May 02, 2011, 04:31:22 pm »
I've posted another installment of the Objective Pascal tutorial:

Part 4: iOS Devices and Xcode 4

http://web.me.com/macpgmr/ObjP/Xcode4/ObjP_Intro.html


Thanks.

-Phil

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #7 on: June 13, 2011, 01:06:58 pm »
Maybe you should state somewhere that there are no spaces allowed in the new project name. If you do use a space, it doesn't compile. Also when you add quotes "" in the build-script, that doesn't work. BEcause when you call your project "test project", the pascal file will be: "test_project.pas", while the build script tries to compile "test project.pas". (When you add quotes, if you don't it will try to compile "test.pas" and "project.pas".

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #8 on: June 13, 2011, 02:40:25 pm »
One more comment: you don't have to use a cross-compiler when you're compiling for the simulator. Using ' ppcross386' on a i386 architecture is nonsense. (It seems to work, I'm quite surprised about that) You only need a cross-compiler if you are compiling for another CPU, as you do in part 4. Each compiler for one specific CPU is able to compile for all supported operating systems on that specific CPU.

Just use 'ppc386' to compile for the simulator. And so you can remove the 'CROSSINSTALL=1' from part 3 of our excellent tutorial.

ie:
sudo make FPC=/usr/local/lib/fpc/2.4.2/ppc386 OS_TARGET=iphonesim install CROSSINSTALL=1
should become:
sudo make FPC=/usr/local/lib/fpc/2.4.2/ppc386 OS_TARGET=iphonesim install

And further only use 'ppc386' in part 3, and change the fpc_sim_compiler_path setting in the template.

And as a side-note: there is not such a thing as 'Objective Pascal'. You make it sound as if it is a new programming language. It's just Pascal. Or maybe 'Object Pascal'. You can even mention that it's using the 'ObjectiveC' mode, it is not another dialect. 'Objective Pascal' does not exist. Although everyone can call it as he wants, offcourse. Did I tell you about 'Loesje Pascal' yet? 

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #9 on: June 13, 2011, 03:54:39 pm »
One more comment: you don't have to use a cross-compiler when you're compiling for the simulator. Using ' ppcross386' on a i386 architecture is nonsense. (It seems to work, I'm quite surprised about that) You only need a cross-compiler if you are compiling for another CPU, as you do in part 4. Each compiler for one specific CPU is able to compile for all supported operating systems on that specific CPU.

Just use 'ppc386' to compile for the simulator. And so you can remove the 'CROSSINSTALL=1' from part 3 of our excellent tutorial.

ie:
sudo make FPC=/usr/local/lib/fpc/2.4.2/ppc386 OS_TARGET=iphonesim install CROSSINSTALL=1
should become:
sudo make FPC=/usr/local/lib/fpc/2.4.2/ppc386 OS_TARGET=iphonesim install

And further only use 'ppc386' in part 3, and change the fpc_sim_compiler_path setting in the template.

No. Reason here:  http://bugs.freepascal.org/view.php?id=17470

Quote
And as a side-note: there is not such a thing as 'Objective Pascal'. You make it sound as if it is a new programming language. It's just Pascal. Or maybe 'Object Pascal'. You can even mention that it's using the 'ObjectiveC' mode, it is not another dialect. 'Objective Pascal' does not exist. Although everyone can call it as he wants, offcourse. Did I tell you about 'Loesje Pascal' yet? 

"Objective Pascal dialect" is the term already in use. Read about Objective Pascal here:

http://wiki.freepascal.org/FPC_PasCocoa

Thanks.

-Phil

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #10 on: June 13, 2011, 07:25:44 pm »
No. Reason here:  http://bugs.freepascal.org/view.php?id=17470

I think you haven't read Jonas comments in that bug-report properly. He clearly states that you can ignore the 'ppcross386' binary. You really don't need it.

About the crossinstall=1, I'm almost sure you can omit that one also, for me it works at least. Also Jonas wrote in a comment that he doesn't understand why the bug-reporter needs it. Probably he had some old files (an old fpcmake, for example) lying around somewhere.

Quote
"Objective Pascal dialect" is the term already in use. Read about Objective Pascal here:

http://wiki.freepascal.org/FPC_PasCocoa

I still don't like the term. And I'm a little bit amazed that Jonas uses it. Normally he's quite precise regarding things like this. But I can't forbid anyone to use it. ;)

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #11 on: June 14, 2011, 10:26:02 pm »
Florian explained me something more about the origin of Objective C. It is a superset of plain c. And what you call 'Objective Pascal' is also a superset on the Pascal language itself. So maybe the name is not as bad as I thought.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #12 on: June 14, 2011, 11:35:48 pm »
Florian explained me something more about the origin of Objective C. It is a superset of plain c.

Yes, as mentioned on page 1 of Part 1 of the tutorial.

More information about ObjC here:

http://developer.apple.com/library/mac/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/_index.html

Thanks.

-Phil





Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: Objective Pascal tutorial: iPhone and iPad
« Reply #13 on: June 16, 2011, 03:46:38 pm »
If you mean this line:

Quote
Objective C's extensions to ANSI C are described here.

You have to change it a little bit. Because it's exactly that line which gave me the wrong idea. That line implies that 'Objective C' is a language which has extensions compared to ANSI C. And that's exactly what it's not.

You can better make it something like: 'The Objective C extensions to ANSI C are described here'

 

TinyPortal © 2005-2018