SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Cross-platform development
             for
           iPhone
   Contributor: Tovchenko Taras
           (Doctor Set)
Plan

• What is cross-platform development
• Benefits & Expenses
• Implementation - 2 ways
• Use open source libraries
• A&Q
What does this mean “cross-platform”?


      1. GUI         2. Business logic
GUI porting is very bag applicable from
    iPhone to desktop platforms




                      -?
How we can distribute business logic?


 1. Base logic - memory, containers, etc.
 2. Logic of your application
 3. Graphic output (OpenGL, convertors)
 4. Audio output (OpenAL)
 5. Databases
What applications we can create full
cross-platform and what can be created
               particles?


1. (Full) Games - 60% at all iPhone applications
2. (Medium) Scientific applications which use graphic
   output - medical, engineering, etc.
3. (Not applicable) Applications based on iPhone GUI
Expenses
1. If you write 2 applications = you pay x2 $
2. Or you can write 1 application for 2 markets = x1.1 - x1.7 $
Several paths for attainment cross-platform




 • Porting existing code
 • Write new code than will be oriented to
    cross-platform
Porting
If you have already wrote project - use this method


                   Problems

1. Existing code wrote on language which not
compile on other platforms, often this is
Objective-C
2. On a project was used system depended api
(on iPhone this is POSIX)
3. GUI - which can’t be ported automatically to
other platforms
Solutions

•   For problem with code we can use some
    emulators of objective-c code - qobjc runtime,
    cocotron library.

•   For system api we can writes wrappers than will
    be defined on concrete platform.

•   GUI - for better case need redesign, for second
    case you can write some automatic engine for
    your dialogs.
Open Source libraries
•   For code porting (objc) currently we don’t have
    optimal solutions. Almost all libraries designed for
    Windows <-> Mac OS but not for iPhone.


               But we can use its for:
1. Learning and looking to its implementations

2. Improve this libraries for iPhone
Solutions for code porting


Lib name       License       Compiler
Cocotron        MIT            GCC
GNUStep         GPL            GCC
 qobjc      Author’s, GPL   Visual Studio
qobjc (quick)
             http://code.google.com/p/qobjc


   Scientific project, this is worked, tested runtime of
                  Objective-C language

Problem: this is only runtime lib, but for full functionality
                    need code parser
Objective-C
        @interface MyDecl : BaseClass <QMyProto2> {
            int _someInt;
            double _someDouble;
            float _someFloat;
        }

        - (float)calculateArea:(float)v0 :(float)v1 :(double)v2 :(float)v3 :(float)v4;
        - (void)dealloc; // in objective-c this method not need declare on header :)



                             Macro code on qobjc
        Q_BEGIN_CLASS(MyDecl, BaseClass)
            Q_INCLUDE_PROTOCOL_TO_CLASS(QMyProto2)
            Q_BEGIN_IVAR_LIST
                Q_DEF_IVAR(_someInt, i)
                Q_DEF_IVAR(_someDouble, d)
                Q_DEF_IVAR(_someFloat, f)
            Q_END
            Q_BEGIN_INSTANCE_METHOD_LIST
                Q_DEF_METHOD(calculateArea:, _calcAreaXY, +f+f+f+d+f+f)
                Q_DEF_METHOD(dealloc, _dealloc1, +v)
            Q_END_INSTANCE_METHOD_LIST
        Q_END_CLASS
New Code
       What benefits?
We can write code on already portable
language as - C++, and some scripting
     languages - LUA, PostScript
    For implementing system API uses
libraries (mostly C++) which wraps this
      work - example dCocoa, QT
Objective-C

-?       (speciality 2.0)
     is not cross-platform
dCocoa
     http://code.google.com/p/dcocoa

               LGPL license

Author’s library for cross-platform
implementation business logics for iPhone
and with possibility run or develop this logic
on Windows platform.
What give your dCocoa now?



1. Convenient Objective-C mechanisms
   emulation. This library writes on C++ and
   approximates to Foundation framework with
   almost all objc-runtime features.
2. Cross-platform between iPhone <-> Windows
1. Keep meta-information
2. Memory management (retain count,
   autorelease pools)
3. Containers (array, set, dictionary) in 2 form
   - for standard C++ types and dcocoa types
4. System dependent features (threads, TLS,
   timer, run-loop, etc)
5. Other helper classes (such as invocation,
   etc)
Objective-C                             dCocoa

@interface MyClass : NSObject {   class MyClass : public CL::dObject {
}                                 COCOA_CLASS_DECLARE(MyClass)
+ (void)method1;                  typedef CL::dObject _super;
- (void)method2;                  public:
                                      virtual MyClass* initWith(t a);
void func() {                         void method1(); // or virtual
  NSAutoreleasePool* pool =
[[NSAutorelease alloc] init];           METHOD_DECLARE(method2) // meta
                                  };
  id obj = [[MyClass alloc]       void func() {
initWith:5];                         _LocalPool

  [_someObject addTarget:obj        CL::dObject* obj =
selector:@selector(method2)];     MyClass::alloc()->initWith(5);
                                    _someObject->addTargetSelector(
[obj release];                          obj, dselector(method2));
[pool release];
}                                     CoRelease(obj);
                                  }
A&Q

Written by Taras Tovcheko, 2009/07/18
    e-mail: doctorset@gmail.com

Mais conteúdo relacionado

Mais procurados

Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
Fan Robbin
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
Douglas Chen
 
3150 Chapter 2 Part 1
3150 Chapter 2 Part 13150 Chapter 2 Part 1
3150 Chapter 2 Part 1
Mole Wong
 
OOP in C - Before GObject (Chinese Version)
OOP in C - Before GObject (Chinese Version)OOP in C - Before GObject (Chinese Version)
OOP in C - Before GObject (Chinese Version)
Kai-Feng Chou
 

Mais procurados (20)

Review: Apitrace and Vogl
Review: Apitrace and VoglReview: Apitrace and Vogl
Review: Apitrace and Vogl
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
 
HKG15-207: Advanced Toolchain Usage Part 3
HKG15-207: Advanced Toolchain Usage Part 3HKG15-207: Advanced Toolchain Usage Part 3
HKG15-207: Advanced Toolchain Usage Part 3
 
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
Vladymyr Bahrii Understanding polymorphism in C++ 16.11.17
 
GCC Compiler as a Performance Testing tool for C programs
GCC Compiler as a Performance Testing tool for C programsGCC Compiler as a Performance Testing tool for C programs
GCC Compiler as a Performance Testing tool for C programs
 
Gccgdb
GccgdbGccgdb
Gccgdb
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
 
Redis: Lua scripts - a primer and use cases
Redis: Lua scripts - a primer and use casesRedis: Lua scripts - a primer and use cases
Redis: Lua scripts - a primer and use cases
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler System
 
FTD JVM Internals
FTD JVM InternalsFTD JVM Internals
FTD JVM Internals
 
3150 Chapter 2 Part 1
3150 Chapter 2 Part 13150 Chapter 2 Part 1
3150 Chapter 2 Part 1
 
LLVM
LLVMLLVM
LLVM
 
Le langage rust
Le langage rustLe langage rust
Le langage rust
 
Cross Platform App Development with C++
Cross Platform App Development with C++Cross Platform App Development with C++
Cross Platform App Development with C++
 
C++ Presentation
C++ PresentationC++ Presentation
C++ Presentation
 
Hands on clang-format
Hands on clang-formatHands on clang-format
Hands on clang-format
 
OOP in C - Before GObject (Chinese Version)
OOP in C - Before GObject (Chinese Version)OOP in C - Before GObject (Chinese Version)
OOP in C - Before GObject (Chinese Version)
 
LLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time OptimizationLLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time Optimization
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 

Destaque

Принципы разработки ПО для iPhone с использованием акселерометра
Принципы разработки ПО для iPhone с использованием акселерометраПринципы разработки ПО для iPhone с использованием акселерометра
Принципы разработки ПО для iPhone с использованием акселерометра
Yandex
 
actsens - Introduction
actsens - Introductionactsens - Introduction
actsens - Introduction
payrow
 
iPhoneDevCamp Ukraine - вступление
iPhoneDevCamp Ukraine - вступлениеiPhoneDevCamp Ukraine - вступление
iPhoneDevCamp Ukraine - вступление
Yandex
 
Обзор фреймворков в iPhone SDK
Обзор фреймворков в iPhone SDKОбзор фреймворков в iPhone SDK
Обзор фреймворков в iPhone SDK
Yandex
 
Unity3d - простой путь к iPhone приложению
Unity3d - простой путь к iPhone приложениюUnity3d - простой путь к iPhone приложению
Unity3d - простой путь к iPhone приложению
Yandex
 
iPhone Unit Testing (Google tool Box)
iPhone Unit Testing (Google tool Box)iPhone Unit Testing (Google tool Box)
iPhone Unit Testing (Google tool Box)
Yandex
 
Push-уведомления для разработчика и пользователя
Push-уведомления для разработчика и пользователяPush-уведомления для разработчика и пользователя
Push-уведомления для разработчика и пользователя
Yandex
 
Thinking Digital Eğitim 1
Thinking Digital Eğitim 1Thinking Digital Eğitim 1
Thinking Digital Eğitim 1
Eren Caner
 
Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)
Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)
Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)
Yandex
 

Destaque (13)

Принципы разработки ПО для iPhone с использованием акселерометра
Принципы разработки ПО для iPhone с использованием акселерометраПринципы разработки ПО для iPhone с использованием акселерометра
Принципы разработки ПО для iPhone с использованием акселерометра
 
actsens - Introduction
actsens - Introductionactsens - Introduction
actsens - Introduction
 
Lunch And Learn July 2009
Lunch And Learn July 2009Lunch And Learn July 2009
Lunch And Learn July 2009
 
025 sds3213 28-toc
025 sds3213 28-toc025 sds3213 28-toc
025 sds3213 28-toc
 
iPhoneDevCamp Ukraine - вступление
iPhoneDevCamp Ukraine - вступлениеiPhoneDevCamp Ukraine - вступление
iPhoneDevCamp Ukraine - вступление
 
Обзор фреймворков в iPhone SDK
Обзор фреймворков в iPhone SDKОбзор фреймворков в iPhone SDK
Обзор фреймворков в iPhone SDK
 
Unity3d - простой путь к iPhone приложению
Unity3d - простой путь к iPhone приложениюUnity3d - простой путь к iPhone приложению
Unity3d - простой путь к iPhone приложению
 
iPhone Unit Testing (Google tool Box)
iPhone Unit Testing (Google tool Box)iPhone Unit Testing (Google tool Box)
iPhone Unit Testing (Google tool Box)
 
Push-уведомления для разработчика и пользователя
Push-уведомления для разработчика и пользователяPush-уведомления для разработчика и пользователя
Push-уведомления для разработчика и пользователя
 
Red Flags Rule General
Red Flags Rule GeneralRed Flags Rule General
Red Flags Rule General
 
Thinking Digital Eğitim 1
Thinking Digital Eğitim 1Thinking Digital Eğitim 1
Thinking Digital Eğitim 1
 
Kanban at Yandex Images (Agile Days 2013)
Kanban at Yandex Images (Agile Days 2013)Kanban at Yandex Images (Agile Days 2013)
Kanban at Yandex Images (Agile Days 2013)
 
Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)
Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)
Хранение данных в iPhone. (FMDB, SQL-Persistence, CoreData)
 

Semelhante a Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью open-source библиотек

MattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxMattsonTutorialSC14.pptx
MattsonTutorialSC14.pptx
gopikahari7
 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)
Jay Patel
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
meharikiros2
 

Semelhante a Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью open-source библиотек (20)

MattsonTutorialSC14.pdf
MattsonTutorialSC14.pdfMattsonTutorialSC14.pdf
MattsonTutorialSC14.pdf
 
MattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxMattsonTutorialSC14.pptx
MattsonTutorialSC14.pptx
 
Objective-C Runtime overview
Objective-C Runtime overviewObjective-C Runtime overview
Objective-C Runtime overview
 
What Makes Objective C Dynamic?
What Makes Objective C Dynamic?What Makes Objective C Dynamic?
What Makes Objective C Dynamic?
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)
 
Devoxx 2015 - Building the Internet of Things with Eclipse IoT
Devoxx 2015 - Building the Internet of Things with Eclipse IoTDevoxx 2015 - Building the Internet of Things with Eclipse IoT
Devoxx 2015 - Building the Internet of Things with Eclipse IoT
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introduction
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...
 
Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Open Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFVOpen Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFV
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью open-source библиотек

  • 1. Cross-platform development for iPhone Contributor: Tovchenko Taras (Doctor Set)
  • 2. Plan • What is cross-platform development • Benefits & Expenses • Implementation - 2 ways • Use open source libraries • A&Q
  • 3. What does this mean “cross-platform”? 1. GUI 2. Business logic
  • 4. GUI porting is very bag applicable from iPhone to desktop platforms -?
  • 5. How we can distribute business logic? 1. Base logic - memory, containers, etc. 2. Logic of your application 3. Graphic output (OpenGL, convertors) 4. Audio output (OpenAL) 5. Databases
  • 6. What applications we can create full cross-platform and what can be created particles? 1. (Full) Games - 60% at all iPhone applications 2. (Medium) Scientific applications which use graphic output - medical, engineering, etc. 3. (Not applicable) Applications based on iPhone GUI
  • 7. Expenses 1. If you write 2 applications = you pay x2 $ 2. Or you can write 1 application for 2 markets = x1.1 - x1.7 $
  • 8. Several paths for attainment cross-platform • Porting existing code • Write new code than will be oriented to cross-platform
  • 9. Porting If you have already wrote project - use this method Problems 1. Existing code wrote on language which not compile on other platforms, often this is Objective-C 2. On a project was used system depended api (on iPhone this is POSIX) 3. GUI - which can’t be ported automatically to other platforms
  • 10. Solutions • For problem with code we can use some emulators of objective-c code - qobjc runtime, cocotron library. • For system api we can writes wrappers than will be defined on concrete platform. • GUI - for better case need redesign, for second case you can write some automatic engine for your dialogs.
  • 11. Open Source libraries • For code porting (objc) currently we don’t have optimal solutions. Almost all libraries designed for Windows <-> Mac OS but not for iPhone. But we can use its for: 1. Learning and looking to its implementations 2. Improve this libraries for iPhone
  • 12. Solutions for code porting Lib name License Compiler Cocotron MIT GCC GNUStep GPL GCC qobjc Author’s, GPL Visual Studio
  • 13. qobjc (quick) http://code.google.com/p/qobjc Scientific project, this is worked, tested runtime of Objective-C language Problem: this is only runtime lib, but for full functionality need code parser
  • 14. Objective-C @interface MyDecl : BaseClass <QMyProto2> { int _someInt; double _someDouble; float _someFloat; } - (float)calculateArea:(float)v0 :(float)v1 :(double)v2 :(float)v3 :(float)v4; - (void)dealloc; // in objective-c this method not need declare on header :) Macro code on qobjc Q_BEGIN_CLASS(MyDecl, BaseClass)         Q_INCLUDE_PROTOCOL_TO_CLASS(QMyProto2)         Q_BEGIN_IVAR_LIST             Q_DEF_IVAR(_someInt, i)             Q_DEF_IVAR(_someDouble, d)             Q_DEF_IVAR(_someFloat, f)         Q_END         Q_BEGIN_INSTANCE_METHOD_LIST             Q_DEF_METHOD(calculateArea:, _calcAreaXY, +f+f+f+d+f+f)             Q_DEF_METHOD(dealloc, _dealloc1, +v)         Q_END_INSTANCE_METHOD_LIST     Q_END_CLASS
  • 15. New Code What benefits? We can write code on already portable language as - C++, and some scripting languages - LUA, PostScript For implementing system API uses libraries (mostly C++) which wraps this work - example dCocoa, QT
  • 16. Objective-C -? (speciality 2.0) is not cross-platform
  • 17. dCocoa http://code.google.com/p/dcocoa LGPL license Author’s library for cross-platform implementation business logics for iPhone and with possibility run or develop this logic on Windows platform.
  • 18. What give your dCocoa now? 1. Convenient Objective-C mechanisms emulation. This library writes on C++ and approximates to Foundation framework with almost all objc-runtime features. 2. Cross-platform between iPhone <-> Windows
  • 19. 1. Keep meta-information 2. Memory management (retain count, autorelease pools) 3. Containers (array, set, dictionary) in 2 form - for standard C++ types and dcocoa types 4. System dependent features (threads, TLS, timer, run-loop, etc) 5. Other helper classes (such as invocation, etc)
  • 20. Objective-C dCocoa @interface MyClass : NSObject { class MyClass : public CL::dObject { } COCOA_CLASS_DECLARE(MyClass) + (void)method1; typedef CL::dObject _super; - (void)method2; public: virtual MyClass* initWith(t a); void func() { void method1(); // or virtual NSAutoreleasePool* pool = [[NSAutorelease alloc] init]; METHOD_DECLARE(method2) // meta }; id obj = [[MyClass alloc] void func() { initWith:5]; _LocalPool [_someObject addTarget:obj CL::dObject* obj = selector:@selector(method2)]; MyClass::alloc()->initWith(5); _someObject->addTargetSelector( [obj release]; obj, dselector(method2)); [pool release]; } CoRelease(obj); }
  • 21. A&Q Written by Taras Tovcheko, 2009/07/18 e-mail: doctorset@gmail.com