iOS Tutorial [Objective C] Writing libraries for B4i

Alberto Iglesias

Well-Known Member
Licensed User
Erel,

I tried with another library and the same error, look:

cd /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/iglesias/bin/Sencha/Cmd/3.1.0.192:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/iglesias/Development/sdk/platform-tools:/Users/iglesias/Development/sdk/tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -L/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -L../../Libs -F/Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload -F../../Libs -filelist /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE.LinkFileList -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lCore -framework Foundation -framework CoreGraphics -framework UIKit -lvnpop -framework AVFoundation -lchilkatIos -lresolv -lpthread -liDebug -Xlinker -dependency_info -Xlinker /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/POP3SAMPLE_dependency_info.dat -o /Users/iglesias/Development/B4i-MacServer/UploadedProjects/iglesias/Payload/POP3SAMPLE.app/POP3SAMPLE
Undefined symbols for architecture arm64:
"std::terminate()", referenced from:
___clang_call_terminate in libchilkatIos.a(CkoAtom.o)
___clang_call_terminate in libchilkatIos.a(CkoBounce.o)
___clang_call_terminate in libchilkatIos.a(CkoCertChain.o)
___clang_call_terminate in libchilkatIos.a(CkoCertStore.o)
___clang_call_terminate in libchilkatIos.a(CkoCgi.o)
___clang_call_terminate in libchilkatIos.a(CkoCrypt2.o)
___clang_call_terminate in libchilkatIos.a(CkoDateTime.o)
...
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for CkObject in libchilkatIos.a(CkObject.o)
typeinfo for _ckBufferSet in libchilkatIos.a(DataBuffer.o)
typeinfo for DateParser in libchilkatIos.a(DateParser.o)
typeinfo for _clsBgTask in libchilkatIos.a(ClsBgTask.o)
typeinfo for _clsEncode in libchilkatIos.a(ClsEncode.o)
typeinfo for ChilkatRand in libchilkatIos.a(ChilkatRand.o)
typeinfo for UnicodeInfo in libchilkatIos.a(UnicodeInfo.o)
...


I using now with this UNIQUE library, don´t have any dependencies, just only one ".a"
http://www.chilkatsoft.com/downloads_ios.asp


In my xcode sample project works perfecly, but when try to compile with B4i no, below is my source code, including this library, my test project and my super simple library for B4i, can you check if forgot some to put in B4i?

http://www.visualnet.inf.br/UploadTemp/testeChilkat.zip

and my B4i sample to use my xcode library

http://www.visualnet.inf.br/UploadTemp/B4iExample.zip



HELP PLEASEE!!!!

I can´t believe in XCODE works and B4i no!


I don´t want develop in XCODE my next app, I´m waiting only for this solution to begin through B4i.




 
Last edited:

JanPRO

Well-Known Member
Licensed User
Maybe it's because of the linker flags, which can not be set in B4i, try to remove the linker flags in your Xcode project an run your app, then check if the error is the same like in B4i ;)
 
Last edited:

JanPRO

Well-Known Member
Licensed User

Alberto Iglesias

Well-Known Member
Licensed User
Erel,

Now it´s working, compiling with no errors.

The only command it´s not working now (and is the same anothers libraries) is for fire the events, look:


-(void)Initialize:(B4I*)bi :(NSString *)EventName {

[B4IObjectWrapper setBIAndEventName:self :bi :EventName];

[B4IObjectWrapper raiseEvent:self :mad:"_oninitialized:" :mad:[]];


// **** I TRIED TOO
[B4IObjectWrapper raiseEventFromDifferentThread:self : @"_oninitialized:" :mad:[]];
[B4IObjectWrapper raiseEventFromDifferentThread:self : @"_oninitialized:" :nil;

[B4IObjectWrapper raiseEvent:self :mad:"_oninitialized:" :nil;

}


and the B4i:

objPOP.Initialize("objPOP")

Sub objPOP_oninitialized <==== NOT FIRE!!!
LogColor("[objPOP_onInitialized]",Colors.Blue)
End Sub


Why????

 

Alberto Iglesias

Well-Known Member
Licensed User
in XCODE

B4X:
-(void)Initialize:(B4I*)bi :(NSString *)EventName {
    [B4IObjectWrapper setBIAndEventName:self :bi :EventName];
    [B4IObjectWrapper raiseEvent:self :@"_oninitialized:" :@[]];
  //[B4IObjectWrapper raiseEventFromDifferentThread:self :@"_oninitialized:" :nil];
}
in B4i
B4X:
Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
   
    objPOP.Initialize("objPOP")
End Sub
Sub objPOP_oninitialized
    LogColor("[objPOP_onInitialized]",Colors.Blue)
End Sub
and in Process_Global
Dim objPOP As POP3


And
 

Alberto Iglesias

Well-Known Member
Licensed User
Perfectly Erel, now it´s almost done....


For create a event to receive a "List" I think is NSArray * wrapper to send no?

Why when I send a NSArray not work? Look my sample:

//~event:DownloadCompleted(Messages as List)

in Xcode

B4X:
NSArray *retArray;
[B4IObjectWrapper raiseEvent:self :@"_downloadcompleted" :@[retArray]];
and in B4i

B4X:
Sub objPOP_DownloadCompleted(Messages As List)
    LogColor("[objPOP_DownloadCompleted]" & Messages,Colors.Blue)
End Sub
When I change to String or Int, works very well, but with NSArray no.

Whats the problem? Where I doing wrong?
 
Top