using my own iOS Static Lib ?

Hi there,

I just created my own iOS Cocoa Touch Static Lib with Xcode.
When build files are created in Debug-iphoneos folder:

libGLib.a
>include
      >GLib
             GLib.h

What are the steps to be able to add and use this self created library into my iOS project ?

  • where to place these files in the project
  • where to copy them for the debug or build phase

Is there any documentation about it ?

Then I will have to handle the declares…

Any help appreciated !

Thanks.

AFAIK Xojo does not support static libraries yet, because or iOS 7 support.

You may want to have a look at https://forum.xojo.com/18657-iosgestures-using-ios-gesture-recognizers for a class that supports gestures.

Seems a bit too complex for my poor knowledge.
I found an AES Encryptor/Decryptor for Objective-C and though I could create a wrapper …

Can be found here

[quote=160914:@Olivier Colard]Seems a bit too complex for my poor knowledge.
I found an AES Encryptor/Decryptor for Objective-C and though I could create a wrapper …

Can be found here [/quote]

You may want to take it step by step. Jumping into Objective-C libraries is probably much more complex than using a fairly easy to use gestures class that is readily available.

Plus, repeat, linking static libraries is not possible yet in Xojo iOS. Norman Palardy may give you more informations, all I know is from a question I asked a while ago about precisely using static libraries.

What is it you want to achieve ?

I’m still looking for an easy way to perform AES or Blowfish encryption class, as mentioned before in

I have a SQLite database which is encrypted and I have the encryption key. But they want to have some specific columns encrypted with AES using the user’s password as key. Some data is really sensitive and they don’t want me or someone else to be able to get this info.

As stated before my customer doesn’t like RC4 encryption, which was an easier solution.
But I’ll talk to them again.

[quote=160922:@Olivier Colard]I’m still looking for an easy way to perform AES or Blowfish encryption class, as mentioned before in

I have a SQLite database which is encrypted and I have the encryption key. But they want to have some specific columns encrypted with AES using the user’s password as key. Some data is really sensitive and they don’t want me or someone else to be able to get this info.

As stated before my customer doesn’t like RC4 encryption, which was an easier solution.
But I’ll talk to them again.[/quote]

You should stick to the same thread, if your ultimate goal is to find a solution to implement AES or Blowfish. Starting several threads will only disperse the issue.

I opened a new thread because it was about using a static lib.
But I’ll follow your advice and post further remark, if any, to the other thread.

I’ll mark your first answer as correct.

Thanks anyway.

[quote=160933:@Olivier Colard]I opened a new thread because it was about using a static lib.
But I’ll follow your advice and post further remark, if any, to the other thread.

I’ll mark your first answer as correct.

Thanks anyway.[/quote]

My response was only partly adequate. I am sorry, since you mentioned Cocoa touch, I inferred you needed touch support, when in fact you needed encryption. Let us continue that discussion in the other thread :slight_smile:

There’s an implementation of Blowfish written entirely in Xojo/REALbasic code
That would be the easiest to achieve this

If I remember correctly, static libraries will actually work. The only problem is that you need to specify the library name as the full path to the .a file on disk, which isn’t very useful when working on a team.

Joe could you give details on the use of static libs?

@Joe Ranieri: [quote]you need to specify the library name as the full path [/quote]
Could you give more info about this ? Where to place the .a and include .h files within the project ? Where to copy them when building, …

@Norman Palardy:[quote]There’s an implementation of Blowfish written entirely in Xojo/REALbasic code[/quote]
I found one googling, is it this one you’re thinking about: ?

Thanks !

@Michel Bujardet : Sorry Michel, I removed your answer as the good one since Joe says it could be possible. Wait and see.

I think you still need to convert .h file into declares.
The question is how we can keep the .a file next to project and put lib name in declares.

You don’t place them in the project. The declare’s library name has to be a full path name to the .a file on disk when you build. It’s less of a feature and more of an interesting side effect of how linking iOS apps for the device works.

Joe, Christian, thanks to both of you.

I’ll let you know if and when I succeed.
I’ve never converted .h file into declares, so be patient ;–)

If you have specific questions on converting .h into declares be sure to ask. An aging but still useful reference on how to write declares is here: https://www.declaresub.com/ideclare/gettingstarted.html, although learning by trial and error is a good way too :slight_smile:

You mean the full path on the development machine ? So for instance I would need to go

Declare Function myfunction Lib "/User/Mitch/Documents/Myproject/toto.a" () as Integer

Or did I understand totally wrong ?

Up until now, we had been told it was impossible to link static libraries, so joe, if you can put us on the path, it will be greatly appreciated. In particular, there are libraries for most everything in Objective-C that are sorely needed for iOS, such as printing and in app purchase, just to name two.

TIA

[quote=161301:@Michel Bujardet]You mean the full path on the development machine ? So for instance I would need to go

Declare Function myfunction Lib "/User/Mitch/Documents/Myproject/toto.a" () as Integer

Or did I understand totally wrong ?[/quote]

I think this should work for device builds. I’ve never actually tried it though.

Well, it won’t work for simulator builds.

[quote=161302:@Joe Ranieri]I think this should work for device builds. I’ve never actually tried it though.
Well, it won’t work for simulator builds.[/quote]

This is great news, though. As we are right now all forced to debug on device, it will not be much of an extra pain to try. And the possibilities look awesome.

I am not very connaissent in Objective-C, but I will try probably next week when hopefully I am finished with my current project. In App Purchase would be a stupendous possibility !

Or maybe our fantastic Christian could look into it ? I would gladly buy iOS libraries from him !