EKEventStore can't save an event after it errors once - iphone

I just came across a bug in my program, that has me confused. I add several events to the iPhone calendar in my app. I found that when I receive a "No end date has been set." error when calling saveEvent:span:error:, all subsequent calls to saveEvent:span:error: result in the same error message. If I change the culprit object to be valid, all events save successfully. Has anybody ran into this? Or do you know why one error might cause all future calls to result in the same error?
I know that I just need to not save an event with no end date set to fix this, but I would like to know why this is happening.
Thanks.

I figured this out. There is a bug in the EKEvent SDK on iOS 5 that is causing this. Hopefully it will be fixed in the first update to iOS 5.
Solution:startDate and endDate should be different.
[event setStartDate:date];
[event setEndDate:[date dateByAddingTimeInterval:1.0]];

Related

Multi Day event in objective c

I want to create an EKevent from objective c, that spans multi-days, in both iOS 5 and iOS 6 the creation process is work as expected, and the event created successfully, but when I fetch the event from an event store the event disappear from the last day -the day that event ends on - this issue exist in iOS 6.
What do you think guys?
I also saw this issue with multi day events. I think it's a bug, so I filed a bug report with Apple about it. I worked around this issue by adjusting my event store predicate for the last day to include 11:59pm of the 2nd-to-last day. After doing that, I then manually filter out the 2nd-to-last day events, if any were pulled in.

Invalid product identifier

I have tried numerous ways to fix this error, but they haven't fix my problems.
I used NSLog and found out that the method productRequest:didReceiveResponse wasn't called.
But I don't know what could cause this.
Here are the things that I have tried:
Upload the binary
Delete app from the device and reinstall it from xcode
waited for a day after i submit the product in iTunes connect
checked 'clear for sale'
doubled checked that i use the full product ID when making the request
Basically i tried everything from Troy Brant's post
http://troybrant.net/blog/2010/01/invalid-product-ids/
But I'm still getting this error.
Please answer if you have any suggestion.
Ensure that you have an SKProductsRequestDelegate and that the SKProductsRequest delegate object is being set, otherwise no messages will get passed around appropriately.

What causes (and how can I fix) this odd Core Location error?

ERROR,Generic,Time,320195751.128,Function,"void
CLClientHandleRegistrationTimerExpiry(__CFRunLoopTimer*,
void*)",Registration timer expired,
but client is still registering!
There are only a few mentions of this problem that I was able to dig up in the wider Internet, and nobody has useful info. Here's the context:
I have an app that monitors the device's location via CLLocationManager's startUpdatingLocation method. It starts monitoring, runs for a little while, then this message pops up in the debug output. From that point forward, no more location updates are delivered.
This error is killing the location functionality of the app, and I'm at a loss as to what may be causing it. It even has an exclamation point at the end, which means it's clearly an exciting error.
Update:
Though I never found a solution to the problem, or figured out why it happens in the first place, I've also lost the ability to reproduce it. This seems to have happened during some period of time in which I did many things, including a general change in code structure followed by update to the iOS 5 beta. Something there seems to have silenced the issue for me.
Have you implemented
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
and does this catch it?
You need to check for kCLErrorNetwork, kCLErrorDenied, kCLErrorHeadingFailure and kCLErrorLocationUnknown in the normal run of things but I'm wondering if there are other errors that the delegate can still catch?
This could give you the opportunity to stop and then restart location services.
Going off of what #schillace had to share, is it possible that you're attempting to force location updates without heeding the user's authorization status?
Try to hold off on calling -startUpdatingLocation until you know that [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized.
I don't know if this is the answer or not, but here's a hint...I'm working with assetFromURL and I'm getting intermittent failures to load images from the asset library. So I wrote a bit of code to test a theory, that loads every url in the library very quickly. I started seeing this error with this bit of code.
So...my theory is that if you make a call that causes the location manager to show the "app wants your location" dialog, and then you continue to make calls while that dialog is up, you'll get this error. Once I acknowledged the dialog and re-ran the program, I didn't see this error any more.
Hope that helps, it's just a guess.
Are you sure this is a problem? It looks to me like you are debugging to a breakpoint (effectively suspending the application) before the registration to the location manager is completed. Meanwhile, the timer expires and you haven't finished your registration. If you take out the breakpoints, does the message ever appear?
Are you doing location stuff on the main thread? I had all sorts of bizarro issues with CLLocation API calls from a background thread. I moved a couple of key setup calls into the main thread, then everything worked fine.
I got the same error and figured out that it was because I had forgotten to mention that the class implements the CLLocationManagerDelegate in the .h file.
Adding the CLLocationManagerDelegate to the header file, and the following line to point to the delegate solved the error for me.
locationManager.delegate = self;
[locationManager startUpdatingHeading];
I got this when implementing the timeout (perform selector after delay) in LocateMe, my previous code used another method. I don't know if this is a clue.
I had forgotten to add
Privacy - Location When In Use Usage Description
I did that and the error went away for me.

what is bus error ? when it comes?

in my application bus error is showing and application crash ..i want to know when this error comes . what mean by bus error ?
in my application page on diffrent id i have to calling libxml parsing . in many times calling, ones it crash .
Usually bus error occurs when you are trying to access a deallocated object. Set NSZombieEnabled to check which object get released.
As getluky states in his answer on Unity Answers:
I've seen SIGBUS often occur on NULL reference exceptions that occur
at runtime. They are usually fairly straightforward to track down via
the XCode debugger - hit the Continue button a couple times while
monitoring the XCode debug console output. It usually will give a hint
as to what file and line number the null reference was in.
Not sure why recreating the XCode project would fix it - it's usually
an issue that recurs unless I can fix the underlying problem

Application has encountered a problem and needs to close

I need to find where the application is running into an unhandled exception. I am supporting this from a previous developer. The application is running and the users aren't interacting with it at the time it crashes. I have ran it in debug mode and it doesn't crash. I know the project in the solution where it happens, but that code is like almost 10,000 lines. Any help would be appreciated.
Add subscription to the AppDomain.UnhandledException event as early as you can:
AppDomain.CurrentDomain.UnhandledException += YourHandler
Inside you can log the exception information and anlyze it later
You aren't giving much to go on. You might want to look up AppDomain.UnhandledException
System.AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
There isnt much info given in the post above. I found following article alot more better:
http://www.switchonthecode.com/tutorials/csharp-tutorial-dealing-with-unhandled-exceptions