-
Recent Posts
Recent Comments
Archives
- March 2013
- December 2012
- November 2012
- August 2011
- July 2011
- May 2011
- February 2011
- May 2010
- April 2010
- November 2009
- September 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
The Coming Acopalypse
Sarah Hoyt has a great post discussing the feeling of sudden and catastrophic change that seems to hang over the world at this point.
In the meantime, at Sound Church we are using the hoopla about the Mayan calendar as an excuse to talk about biblical prophesy. Not that I expect the end to come in the next year, or even 30 years. It’s just interesting.
I don’t think an extinction-level event is eminent, although the dinosaurs didn’t think so, either, we are facing the beginnings of what could be an economic collapse. It won’t be pretty. No one knows what will emerge from the other side, but it’s almost inevitable, at this point.
Religion and Politics, Western Style
Sarah Hoyt posted today with her usual high quality look at how hp things got to where we are today. She also has good advice, pointing out that there are differences between Americans and others.
This time she looks at the religious nature of the socialist worldview.
Working Again!
After six weeks of no income, I started work this week at TeleCommunication Systems (TCS). I’m assigned to the team working on next generation 911, also called NG911.
Our existing system was designed when land line phones dominated before cell phones were even heard of, at least to the general public.
In the intervening years, cell phone service, and later Voice Over IP (VOIP) or internet phones have been scabbed into the system with some hacks. Good hacks, but they are still hacks. The Next Generation system that the National Emergency Number Association (NENA) has defined will provide a more solid and extensible base for handling the existing system and future growth, including text messages, photos, videos and other sources of information that our mobile communications make possible that can help the emergency responders be better prepared for the situation at hand.
Technorati Tags:
Development, TCS
Bug in Core Data?
After a great deal of searching around and playing with alternatives, I’ve figured out that if I insert new records into the SoundChurch store one record at a time, everything works. If I allow Core Data to attempt to insert multiple records at once, it throws the error discussed in the previous post.
Could I have discovered a bug in Core Data?
CoreData error saving data
As I continue to attempt to improve the operation of the Sound Church application, I’ve run into issues with Core Data returning an error when I attempt to save an Item.
The error:
2011-07-09 16:57:36.670 Sound-Church[12292:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=256 “The operation couldn’t be completed. (Cocoa error 256.)” UserInfo=0x4d62010 {NSFilePath=/Users/john/Library/Application Support/iPhone Simulator/4.3.2/Applications/BF78B117-48CA-48C7-A61E-29A452E2824A/Documents/Sound_Church.sqlite, NSUnderlyingException=error during SQL execution : constraint failed}, {
NSFilePath = “/Users/john/Library/Application Support/iPhone Simulator/4.3.2/Applications/BF78B117-48CA-48C7-A61E-29A452E2824A/Documents/Sound_Church.sqlite”;
NSUnderlyingException = “error during SQL execution : constraint failed”;
}
I see the error from this code:
- (void)saveContext
{
NSLog(@"Entering saveContext");
NSError *error = nil;
NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
if (managedObjectContext != nil)
{
if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error])
{
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
}
}
In searching the web, I found this article that talks about that very message, but it doesn’t seem to apply as apparently the writer is directly accessing the sqlite database, which I don’t do.
I also found this question and answer, which suggests a possible problem, but again, I don’t see it applying to me, as I use a NSFetchedResultsController to populate the UITableView and otherwise only fetch results to verify that the new Item is unique.
The code where I fetch results to check for an error:
- (void)parser:(NSXMLParser *)parser
didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI
qualifiedName:(NSString *)qName
{
if (!self.currentItemObject)
{
// We don't want to bother attempting to process all the header info.
return;
}
if ([elementName isEqualToString: kItemElementName])
{
NSPredicate *predicate = [NSPredicate predicateWithFormat: @"guid == \"%@\"", currentItemObject.guid];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
[request setPredicate: predicate];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Item"
inManagedObjectContext:self.context];
[request setEntity: entity];
NSError *error = [[[NSError alloc] init] autorelease];
NSMutableArray *items = [[context executeFetchRequest: request error: &error] mutableCopy];
if (!items)
{
// TODO: Need to do better error handling.
NSLog(@"Error fetching items. %@", [error localizedDescription]);
[items release];
return;
}
if (0 < [items count])
{
// This is a duplicate element, we don't want to save it.
[items release];
return;
}
[items release];
...
At this point, I haven’t resolved this issue, so I’m still looking for a solution.
In the process of digging through the code, I did stumble upon another problem. I found that the title of the podcasts seemed to always be the same as the summary. So I did some digging, and found that, in fact, I was not copying the data elements into the NSManagedObject. Dumb.. Since the objects (NSStrings in this case) are passed as pointers, when I would write the next string into the same NSMutableString, it overwrote the previous entry, so all elements of an object became the last thing I entered.
So that’s solved, but I’m going to have to do some more digging into the sqlite table to figure out the problem with the error.
Sound Church Progress
I’m now getting the podcast data to load into the CoreData store, but still getting a BadAccess Exception that I haven’t tracked down. Still looking to find out where I’m accessing something after it’s deleted.
I have an image of the screen. Not really exciting, especially since it seems to be loading the one item multiple times, and that one item is the lone video in the package.

I’m thinking I’ll break the connection I have between the Channel object and the Item objects. The connection is somewhat arbitrary, and I’m not even sure I need the channel, but I have it for now. I certainly don’t need the connection to the channel.
Latest code has been uploaded to github (github account required), for anyone who’s interested to look at it.



