sqlite3_step gives an error - ios4

I have a project created in iOS 4. But I have to move to iOS 5.1. When I run it in iOS 5.1, it gives an error in here.
`
if (sqlite3_prepare_v2(database,query_stmt, -1, &statement, NULL) == SQLITE_OK){
NSLog(#"2nd if");
while(sqlite3_step(statement) == SQLITE_ROW){
NSLog(#"error: %s\n",sqlite3_errmsg(database));`
This error message is print as unknown error
But there is a simmilar code to load a UITableView. It works without any issue. This has run on iOS 4 without any issue. Can any one help me
Thanks

Related

Android studio Unable to add window -- token android.os.BinderProxy#499c862 is not valid; is your activity running?

I've gone through lot of posts about this issue before I post my own question , and Im still not able to find any solution to it , in fact I don't even know where the problem is !
I keep getting this crash everyday on my crashlytics dashboard ( only for few users ) . Unfortunately its only giving me the crash infos but not showing which line or class is causing it , and other thing is that 100% of devices affected are using Android 7 & most of them are Amlogic devices ( eg : X96 mini , TX3 mini )
I understand that this is most likely happening because Im trying to show a dialog after execution of a background thread, while the Activity is being destroyed , so I checked all my code and I've added to each dialog the condition below
if(!YourActivityName.this.isFinishing())
{
//show dialog
}
Here is the LogCat:
Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy#499c862 is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at android.widget.Toast$TN.handleShow(Toast.java:459)
at android.widget.Toast$TN$2.handleMessage(Toast.java:342)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)

Windows 10 >= 1809 issues with jacob and Word ComObject

we have an old legacy app which uses Java version 1.6 update 45 (jdk-6u45-windows-i586.exe) and Jacob.dll 1.8 (jacob_18.zip), and which cannot be updated :(
Everything was working fine till the latest Windows 10 1809 Update. Since then the comobject behavior seems to have changed and causes an error as well as that the word document cannot be saved anymore. I also tried 19H1 but got the same error.
I could reproduce the issue in java with following code, of course you have to import the Jacob.dll:
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;
import com.jacob.com.Dispatch;
ActiveXComponent oWord = new ActiveXComponent("Word.Application");
oWord.setProperty("Visible", new Variant(true));
Dispatch documents = oWord.getProperty("Documents").toDispatch();
String str_file = "C:/temp/test.rtf";
Dispatch doc = Dispatch.invoke(documents, "Open", Dispatch.Method,
new Object[]{str_file},
new int[1]).toDispatch();
The error I get is:
Exception in thread "main" com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: Open
Description: An unknown COM error has occured.
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:384)
at com.jacob.com.Dispatch.invoke(Dispatch.java:267)
at Main.main(Main.java:21)
When I click on the Dispatch errors I only get that it is not a valid line number in com.jacob.com.Dispatch
I know it is not the best day not updating the legacy app itself, but what can I say, it is as it is.
Any ideas what might have changed in Windows >= 1809 or how it can be solved without touching the app?
Thanks
Stephan
Edit:
Dispatch oDocument = Dispatch.call(documents, "Open", str_file).toDispatch(); leads to the same error
I should mention that Word opens, but I am not able to save the file and that the return value is an error
OK, the error is the same which is covered in this post:
Exception from Word.ApplicationClass.Activedocument all of a sudden
So it seems to be a bug in >=1809 and for the moment the only fix is to change/play with the regional settings

Using your NSURLResponse(webViewHack)

I now went to put this code check SO into another app and I am getting an error on the line:
if ((self = originalImp(self, _cmd, cf))) {
The build error is:
"Too many arguments to function call, expected 0, have 3"
I am using Xcode 6.2 compiling for iOS 7.1
Thanks
K
You can Disable the check in the Project Build Settings by setting 'Enable strict checking of objc_msgSend Calls' to No.
Has worked for me in similar situations. Filter the Build Settings on the keyword 'strict' to find it easily.

initWithContentsOfURL returns nil on iOS 7 on device; fine in Simulator

This ran fine before upgrading to iOS 7 and XCode 5:
NSMutableArray *test;test=[[NSMutableArray alloc] initWithContentsOfURL:[NSURL URLWithString:#"http://avia.se/iphone/gillabilen/test.xml"]];
As you can see, the URL loads fine in a browser. It validates as UTF-8. The method isn't deprecated.
It returns nil running tethered to an Iphone 4 running iOS 7. Works fine in Simulator 7.0.
I'm completely stumped here! :) Any advice appreciated.
Try this :
NSArray *a = [NSArray arrayWithContentsOfURL:[NSURL URLWithString:#"http://avia.se/iphone/gillabilen/test.xml"]];
NSLog(#"%#", a);
Returning in my console :

Is there any sample for ALAssetsLibrary

For iPhone 4 , a lot API can not be used any more.
I am looking for alternative solution for UIImageWriteToSavedPhotosAlbum.
ALAssetsLibrary is current solution from Apple in new iOS 4.
Anyone has experience for that and can give some samples, or open source projects ?
Thanks
you need to do something like this -
ALAssetsLibrary* library=[[ALAssetsLibrary alloc] init] ;
// Request to save the image to camera roll
[library writeImageToSavedPhotosAlbum:img.CGImage orientation:(ALAssetOrientation)img.imageOrientation
completionBlock:^(NSURL* assetURL, NSError* error) {
if (error != NULL)
// Show error message...
else // No errors
// Show message image successfully saved
}] ;
Although I'm going crazy trying to figure out how to keep this code compatible with iphone 3 SDK.

Resources