I have iOS app that uses time to download info from data provider. Now problem is, that for some times around midnight, there is a bug in my app and data are not downloaded correctly (there is no problem with data on the server, data are correct). How can I debug this?
Solution with being awake around midnight is not very helpful, because I have only limited window when error occurs and after that, all is OK again. So, before I can pin-point what is wrong, time passes and I have to wait another day :-/
You have 2 options. You can either:
Set your iPhone time manually:
Settings --> General --> Date & Time
Select Set Automatically to OFF
You will see the current time at the very bottom. Select it to show a DateTime wheel to set it to whatever you want.
The Simulator can also be adjusted my adjusting the time on your Mac.
I have run into the same situation and it has helped me.
NOTE: You will have strange things happen if they are also date driven like scheduled appointments.
You might be able to reproduce it by using the iPhone Simulator and setting the system clock on your Mac.
If it's something like time synchronization problems between your app and the server (Amazon Web Services' API does this), then I'm afraid the only solution will likely be to stay up until midnight, or go through your code with a fine-toothed comb. That's hard, but it sometimes works.
A suggestion that would help you in these cases would be something like https://github.com/CocoaLumberjack/CocoaLumberjack, where you can log information to a file and email it, so you can debug issues like this even when not connected to Xcode.
Related
I have spent the last 4 days coding 20 hours a day to make my first self guided project ever for iOS. I had a working prototype and decided to tackle the layout for landscape mode. Long story short, in my fiddling I made mistakes that ruined portrait mode and so I (being a complete novice in Xcode and to programming) accidentally clicked discard all changes thinking it would reset me to my last save. It ended up wiping my whole file and dumping some of the old contents into the trash.
I could only find half my project in the trash so I was hoping I could recover the code from my test iPhone that has an older version of the program saved on it and just start again from there (with backups this time).
My iPhone is a physical version (not the Simulator)
When you said Discard All Changes, you were warned that this would discard all changes. If you went ahead and did it anyway, you have only yourself to blame: you were warned! You are now back your previous commit. Nothing after that is recoverable.
The correct procedure would have been, not to discard your changes, but to commit them! Now the current state of things would have been saved, and you could then proceed to work your way backwards to a working state of things in a recoverable and systematic manner.
By the way, this is not an Xcode matter or a programming matter; it's a version control matter. It's very good that you are using git, but perhaps you should pause and read up on it before you continue using it.
Unfortunately it is likely that you are out of luck here. Normally you would commit the changes and then, if you don't want them, you can revert back (and forward) as you wish. If you had commited (or stashed/staged) then you would be ok.
But...
There is a small possibility that Finder can help you though. Read this answer and see if that helps.
Basically, quit Xcode, open the file that you were working in using TextEdit, go to File > Revert To > Browse All Versions and see if you can restore one that you previously used. Do this for each file and then reopen Xcode and keep your fingers crossed and pray to the code gods!
I am using the latest tag named "tip" and I am using JIRA on demand.
I just incorporated JIRA mobile connect into my ios app and it is behaving a bit oddly i.e. it is going into an infinite loop and hangs my app.
After turning the debug mode on and digging a bit deeper, I find the source of this problem is that the sqlite database table is locked.
The sequence of events is like follows:-
I launched my app for the first time
I created an issue successfully using JIRA mobile connect
I shut down my app
I updated the issue by adding comments in JIRA online via the web interface (to simulate a 2 way communication scenario)
I re-started my ios app
JMC gets the updates from JIRA rest api using https://xxxx.atlassian.net/rest/jconnect/1.0/issue/updates?sinceMillis=1408380024967&uuid=9371F70F-12CD-47EC-AB3E-4B0398FF453E&apikey=YYY&project=AAA- and it is able to find the updates that I had made in step 4
Since it finds changes, JMCIssueStore.m calls updateWithData method which has logic in it i.e.[self createSchema:YES] which attempts to drop the existing 2 tables and recreate the schema.
On the 1st table drop attempt i.e.[db executeUpdate:#"DROP table if exists ISSUE"],
the database table is found to be locked and JMC goes in an infinite loop retrying to execute this statement.
I am unable to find any answers for this on the Atlassian Q&A portal or otherwise on the web and I find it surprising as surely other people using this should be having the same issue or I have done something obviously wrong in trying to integrate it.
Has anyone encountered this or something similar? As this is one of the key features for which I am using JIRA Mobile Connect, i really need to figure out if it is worth debugging Jira mobile connect for this or just giving up and doing it from scratch.
The whole issue stemmed from a documentation error in the integration process of JIRA Mobile Connect specifically step 9 here where they asked to exclude all the JMC files from using ARC - which I had done. This is the root cause of the problem.
After going through the Angry Nerds Sample files and comparing it with my own, I realised they were exactly the same and still the Angry Nerds sample worked and mine didnt.
I retraced all my integration steps and on reaching step 9, it struck me that when I was going through the code, there were no sign of any manual release statements - which was odd if the code was indeed not using ARC.
I removed all my -fno-objc-arc flags from all the JMC files. And hey presto! the crashing issue isnt there anymore.
I recently changed from developing iOS apps on a MacMini to a new MacBook Pro (2.2 GHz Intel Core i7). While working in XCode, I occasionally get pop-ups when the system is apparently trying to do an autosave and runs into a problem.
The pop-ups state "The document [filename] could not be autosaved. The file has been changed by another application. Click Save Anyway to keep your changes and save the changes made by the other application as a version, or click Revert to keep the changes from the other application and save your changes as a version."
Examples of the filename are: AppDelegate.m, MyLoginViewController.m. There shouldn't be anything else that is changing those files.
I can't do anything within XCode until I choose one of the options. Sometimes it seems like the system is trying to overwrite my newest code with an old version of my code, sometimes it seems like it is trying to save my newest code. So, sometimes Revert is what I need to do to keep my current version, and other times Save Anyway is what I need to do. However, sometimes, I can't tell what the system is trying to do and I choose the wrong option and lose hours of work.
This has happened numerous times over a span of three weeks.
I am using OS X 10.7.2 and XCode 4.2.1. The code is on my MacBook's hard drive.
Does anybody have any idea why this is happening?
Thank you.
This is a huge problem, and it looks like it's Lion's force-fed "file-versioning" that is destroying work.
I typed quite a bit of code into my source and saved it regularly (pretty much after every complete paragraph). Suddenly I couldn't find an entire section that I'd just written. I even did a project-wide search, in case I'd accidentally entered it in the wrong file. Suddenly Xcode raised a dialog saying it couldn't autosave the file because it had been modified externally. Did I want to "revert", or save what was in the editor?
In the several times I've seen this come up on two systems over the past few weeks, I've chosen to save what's in the editor, thinking that obviously it must be the most recent version. WRONG. I hit "Revert", and the block of code reappeared.
There is so much wrong here, it's hard to decide what's the most offensive.
Confirming that this happens on XCode 4.3.2 on an iMac running 10.7.4.
I have found that this bug may be related to having the same file open in more than one tab or window in XCode. If you carefully avoid ever having more than one window open on a given file at a time I think you can avoid this problem. However, it undermines the very useful ability to apple-click method names to navigate to the file that contains them.
This has cost me hours of original work and been the source of immense frustration. The derisive comments from others are simply inadequate.
I heard they had a complicated fix for it already at Apple, but unfortunately, it was "accidentally lost" and now they can't remember which files need what changes to make it work again. :-/
I am developing one application for iPad, this application used some content such as video/audio/image etc, about 8 GB.
So when click the BUILD button in xcode4, it will take nearly 1 hour to build it.
I need to figure out which cause so long time.
I know that once we trigger the building, we have procedures like complier, link etc.(normal sense ), now my purpose is to optimize the building, so need figure out how many procedures happened when trigger building in xcode4, and what is the longest part in my case.
Thanks for your answers in advance.
You could go in Preferences>Behaviors>Build starts>Navigate to>current log.
I'm developing an application on two different machines (home and work) and while the home one seems to run just fine, the work one is, for lack of a better word, possessed. It has been exhibiting the following issues:
When loading the application, it will start at the simulator's main screen instead of starting the application at random intervals. You can start the application and have it work fine, then close the simulator, reload, and have the same codebase not load.
Going to applications doesn't show the application itself, in fact it never does.
Trying to load the applications cod file (File->load java program) never works. Tried the steps in this thread, with unreliable results.
Extremely small changes, such as modifying the value of a width variable by one, commenting out a function such as makeMenu or adding a button will cause code to no longer work, with no errors shown by the IDE.
Using clear.bat with sometimes work, sometimes not. Same with manually removing all files with the name of the project.
reinstalling the eclipse environment and the blackberry plugin did nothing more then burn off an hour.
having "load on startup" in the blackberry_app_descriptor.xml file is set.
Both systems are using Eclipse 3.5.1, BB plugin for eclipse 1.1 beta, Java 4.5 with the 8300 simulator. THe only difference that I am seeing is the operating system between the two systems. The work one being XP Sp3, home being vista. THe vista one isn't perfect, but I can test variable changes without flipping a coin to see if the app will even load or not.
I've tried the solutions that were similar on this forum, such as this one, but it looked to be that those solutions are dated as none of the options for the steps existed in my eclipse install.
So has anyone ran into such baffling behavior, and can it be fixed? Anything that I might have missed that could be tried?
I've been seeing this behavior with the new 1.1 plugin, the application doesn't load on startup and the FIle->load java program doesn't help. For me, the solution was I have to run a clean build every time, that is the eclipse clean and build instead of just build, not the clean.bat... Hope this helps!
Try clearing resources that have improper naming structure in your projects stuff with spaces or special character in the name of the file.
It took me two days to figure out.
One solution i got regarding your problem.
As I See Please run the application first time as Run as blackberry simulator
that is got start and here pick up run and then Run as Blackberry simulator