Tesseract change Language iOS - iphone

Can anyone explain me how can I change the language from eng to german.
When i download the new library from the Google Side and I include this in the tessdata the result is NULL.
Can anyone help me please??

I decided to write a new answer.
After testing it out myself, I think the problem is the files are not copied to your device correctly.
Check if 'tessdata' is included in the "Copy Bundle Resources".
You can find that by clicking on your project > target > build phases
if not, click on the + button to add the tessdata files. (Note: make sure "copy items into destination group's folder (if needed) is NOT checked, and "create folder references for any added folder" is CHECKED)
If that doesn't work, please find the method that is copying the tessdata to your app bundle, and check the error that it is returning.
Hope that works for you.

Related

Finding the right way to include static libraries in Xcode

First of all I have to say that I'm new with Xcode and I found some things a bit comfusing for beginners.
For now I want to include SQLite support in my test app. I found the wrapper "FMDB" which seems very easy to use.
I was already able to include the .m and .h files into my project and setting the header line for bridging to Swift.
But if I build my app then I will get some link errors. I think the problem is that the sqlite library is missing. But I've no idea to include it. So I searched the web for some tutorials but all I found seems too old and didn't help me.
What I've already done are the following steps: I selected the top item of my project in the Project Explorer. Then I selected my build target and switched to the tab "Build Phases". But now I see no possibility to include the libsqlite.a file. I followed some suggestions and typed the keyword "sqlite" in the search field but I only get the message "No results found."
I'm using Xcode 8 + Swift 3 on Mac Sierra.
I think that U should find libsqlite.a file in the filesystem and only then add libsqlite.a to project by right click on project files in Xcode 8 and selecting "add files to " and select you .a library from system location like Homebrew's sqlite root folder, only then you can select this static library in "+" linking menu. Please read this answer:
https://stackoverflow.com/a/15974037/2835276
I solved my problem by including sqlite3.c and sqlite3.h from sqlite.org so every wrapper works fine.

Error "_OBJC_CLASS_$_ISTAlertView", referenced from:"

When I am compiling my code I am getting this kinda errors...
_OBJC_CLASS_$_ISTAlertView", referenced from:
Any clue what could be the reason?
That error shows up when the .m file containing ISTAlertView is not being compiled into the target. The file may be there or it may not be; it's just not getting compiled. If this is from a library, then you're not linking in the library, so the compiler doesn't know where to go to find the ISTAlertView class.
If the file is yours, find it and "Get Info" on it in Xcode. Then go to the "Targets" tab and make sure the checkbox is checked next to the target the file is supposed to be in. If it's already checked, then clean your build and try again.
If it's in a library, then make sure the library is part of the "Link binary with libraries" phase of your target compilation.
The code file ISTAlertView.h and possibly also ISTAlertView.m are not present in your project. Right click on your classes folder and select "add Existing files". Navigate to your Classes folder and check if you can find them there. If not, go looking under the desk :)
It's only .m file that is missing... You didn't provide details about your project, but it if this source in the static library be sure you link it with the project, where the calling source reside. Of and referenced from... which you omitted can tell you which source uses functions from ISTAlertView.m.

Integrating kal calendar in my application

I have religiously followed all the steps provided on the following link to integrate kal into my project. Everything went well with the steps but finally when I compiled my project (after adding the #import "Kal.h"), it raises a compilation error: Kal.h no such file or directory. I have tried this from iPhone SDK 4.1 and have really tried it many times so far. Your quick help is highly appreciated in this regard.
https://github.com/klazuka/Kal
You must have messed with the 6th point as your include path doesn't seem to cover this file:
Finally, we need to tell your project
where to find the Kal headers. Open
your "Project Settings" and go to the
"Build" tab. Look for "Header Search
Paths" and double-click it. Add the
relative path from your project's
directory to the "Kal/src" directory.
If you adjust it, it should work. Make sure to make the change for all configurations (debug, release, etc.).

How do I properly add existing source code files to my Xcode project?

I'm new to iPhone development and I'm still getting familiar with the Mac dev environment, including Xcode. I want to add some 3rd party code to my iPhone project, but when I add the "existing files" to my Xcode project, I'm presented with a dialog box that has far too many options that I don't understand and, as such, my project isn't working. When I #import headerfilename.h, I get a build error that reads headerfilename.h: No such file or directory.
alt text http://joecrotchett.com/images/misc/fileadd.jpg
Can anyone explain to me what all these options mean or give me a link to some documentation that can? I'm having a hard time finding anything in Apple's docs.
Which options do I want to choose to add existing source code files to my Xcode project? I should note that the source code files that I'm trying to add are located in my project/Classes/frameworkname/ directory.
After they're added, do I need to reference this new code directory in my project settings anywhere (i.e. some kind of header file directory variable)?
Thanks so much!
Update: I found the following answers/responses on the apple dev forums that were very useful and helped me fix my issue...
To make it simple :
- if you do not check the copy option, the file stay where it is.
- if you check it, it is copied in your project folders In the first case
(what it seems you are doing) you need
to tell the compiler that the header
files are in another directory :
- project info -> build -> search paths -> User Header Search Path : add
the directory from where you took the
header file Hope this will help
You have discovered the most confusing
dialog box that ever came out of
Cupertino. Six years of Xcode, and
this thing still is partly a mystery
to me. To even get that far, I had to
make many test projects to try and
reverse-engineer what this thing does.
The "Copy" box means that it will copy
the files as they are right now, into
the project. If this box is not
checked, then it just references those
files during a build and copies them
as they are at THAT time. For source
code, you want the Copy box checked.
The "relative to" is a total mystery
to me and I can't help you with that.
I usually leave it however it is
already set. Does it mean relative to
where they are on disk, or the
arrangement in Xcode, or in the
bundle? Who knows. The last 2 radio
buttons SEEM to mean that it will
either re-create the folder structure
of the folder you are adding, or just
put "fake" folders in Xcode that point
to the real folders. This is probably
your problem - you are adding source
code that is not all at the top level,
and when it goes to find it, it does
not re-create the hierarchy. Others
can supply a better way, hopefully,
but what I would do is put all of the
source in one folder and add that,
using the Copy box. Then in Xcode you
can make whatever bogus folders you
want and put the source file names in
those fake folders.
This is from the Xcode user guide:
"The project navigator shows projects, groups, folders, and files:
The project or projects in your workspace window are the highest level
of the hierarchy in the project navigator. Open the project’s
disclosure triangle to see the groups, folders, and files in the
project. Select the project to display the project editor, where you
can view and edit project and target settings.
A group appears in the project navigator as a yellow folder icon. The
group does not represent a folder on disk. Although you can organize
your project in Xcode to reflect the organization of files on disk,
moving files into and out of groups does not affect the content of the
folders on disk, and moving files on disk into and out of folders does
not affect the content of the groups in the project navigator.
A folder is a reference to a folder on disk and appears in the project
navigator as a blue folder icon. The contents of the folder in the
project navigator reflect the contents of the folder on disk. It’s
important to note, however, that the files that appear in a folder
icon in the project navigator are not part of your project unless you
have added them to the project explicitly (in which case they appear
directly under the project or in a group, as well as in the folder).
You can view and edit the files in a folder, but to move files in and
out of the folder you must use the Finder.
A file in the project navigator is a reference to a file on disk."
I think usually the default option is the best one. If you want to add into some group, you can tick on the "Copy Item to Destination group"
You don't have to change any project settings after adding
And if you want to add the whole framework code, please choose add existing framework
Copy items into destination group's
folder (if needed)
Well, only if you want it to copy the files. If you are happy with their existing location and don't want it to copy them, don't select it (that's what I do).
Reference Type:
A total mystery to me
Text Encoding
Self explanatory
Recursively create groups for any
added folders Create Folder References
for any added folders
Leave this as the default and then organize the folders in your Xcode project any way you want.
Add to targets
If you add an additional target to your project, e.g. for iPhone vs. iPad versions, then not noticing that it has by default added the files to just one of them (at random?) can cause headaches.
Also, make sure you add the new header directory to your search paths in Project Settings > Build > Search paths. I think that's what's causing your problem.
Hope this helps, I remember how confusing this was to me at first.
If you want to add an Framwork Bundle, just add is as one. Add -> Existing Frameworks

How do I consolidate my Xcode project files?

When I started working on my first app, i assumed dragging files into xcode put them in my project's actual directory. Not so. Apparently Xcode references them all on the desktop.
Is there an easy way to copy all referenced files into the project directory? My desktop is a mess.
Use the Finder to relocate all the files to where you want them. Then, open your Xcode projects, and for each file that's missing (shown in red), use the Get Info command and edit the path.
There really isn't a straightforward way to do this once you've added the references to the Xcode project.
One solution (although tedious and slightly scary) is to remove the references from Xcode and re-drag these files into your project with the "Copy files..." option checked.
Even when you check the "Copy files ..." checkbox when you drag your files in, it's done "When necessary", without telling us when it thinks it's deemed not necessary to copy the files. I'd find that the best way to check if a bundle is self-contained is to compress it to .zip (the entire folder), move it to a temp folder, decompress and then go through all the files, or simply compile and run.
It's amazing that Xcode doesn't have a consolidate function like iTunes does.
From Xcode, you can right-click the project and select "Add -> Existing files..." When you have selected all your files, click "Add," then select the check box at the top "Copy files..."