Search Results

Search found 7 results on 1 pages for 'swalkner'.

Page 1/1 | 1 

  • Adding Core Data to existing iPhone project

    - by swalkner
    I'd like to add core data to an existing iPhone project, but I still get a lot of compile errors: NSManagedObjectContext undeclared Expected specifier-qualifier-list before 'NSManagedObjectModel' ... I already added the Core Data Framework to the target (right click on my project under "Targets", "Add" - "Existing Frameworks", "CoreData.framework"). My header-file: NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext; NSPersistentStoreCoordinator *persistentStoreCoordinator; [...] @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; @property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; What am I missing? Starting a new project is not an option... Thanks a lot! edit sorry, I do have those implementations... but it seems like the Library is missing... the implementation methods are full with compile error like "managedObjectContext undeclared", "NSPersistentStoreCoordinator undeclared", but also with "Expected ')' before NSManagedObjectContext" (although it seems like the parenthesis are correct)... #pragma mark - #pragma mark Core Data stack /** Returns the managed object context for the application. If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. */ - (NSManagedObjectContext *) managedObjectContext { if (managedObjectContext != nil) { return managedObjectContext; } NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { managedObjectContext = [[NSManagedObjectContext alloc] init]; [managedObjectContext setPersistentStoreCoordinator: coordinator]; } return managedObjectContext; } /** Returns the managed object model for the application. If the model doesn't already exist, it is created by merging all of the models found in application bundle. */ - (NSManagedObjectModel *)managedObjectModel { if (managedObjectModel != nil) { return managedObjectModel; } managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain]; return managedObjectModel; } /** Returns the persistent store coordinator for the application. If the coordinator doesn't already exist, it is created and the application's store added to it. */ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator != nil) { return persistentStoreCoordinator; } NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Core_Data.sqlite"]]; NSError *error = nil; persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:nil error:&error]) { /* Replace this implementation with code to handle the error appropriately. abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button. Typical reasons for an error here include: * The persistent store is not accessible * The schema for the persistent store is incompatible with current managed object model Check the error message to determine what the actual problem was. */ NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } return persistentStoreCoordinator; }

    Read the article

  • Hibernate: Check if object exists/changed

    - by swalkner
    Assuming I have an object Person with long id String firstName String lastName String address Then I'm generating a Person-object somewhere in my application. Now I'd like to check if the person exists in the database (= firstname/lastname-combination is in the database). If not = insert it. If yes, check, if the address is the same. If not = update the address. Of course, I can do some requests (first, try to load object with firstname/lastname), then (if existing), compare the address. But isn't there a simpler, cleaner approach? If got several different classes and do not like to have so many queries. I'd like to use annotations as if to say: firstname/lastname = they're the primary key. Check for them if the object exists. address is the parameter you have to compare if it stayed the same or not. Does Hibernate/JPA (or another framework) support something like that? pseude-code: if (database.containsObject(person)) { //containing according to compound keys if (database.containsChangedObject(person)) { database.updateObject(person); } } else { database.insertObject(person); }

    Read the article

  • Flurry's not collecting any data from my iPhone-app

    - by swalkner
    Hi all, I want to use Flurry to collect some statistics, so I registered and created an app in Flurry. Then, I put the following code in my appDidFinishLaunching: [FlurryAPI startSession:@"code here"]; Afterwards, I installed the app on my iPhone and ran it - but I don't see any data online. Am I missing something? And is data also collected from the simulator? Thanks a lot, Stefan

    Read the article

  • iPhone SDK - keep data in modal view

    - by swalkner
    Hi all, I've got a modal view loaded the following way: ModalViewController *modalController = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil]; searchController.delegate = self; [self.navigationController presentModalViewController:modalController animated:YES]; [modalController release]; When the modal view appears, "viewDidLoad" is called. When I dismiss the modal view via [self.navigationController dismissModalViewControllerAnimated:YES]; the method "viewDidUnload" ISN'T called, but the next time I let the modal view appear, "viewDidLoad" is called again. My problem now is that I'm creating an NSArray in the modal view's "viewDidLoad" - and as I'm fetching the data from the web, I would like to do it only once. But this way, it's fetched every time... Any hints how I could achieve that the data is only fetched once? I would really like to do it in the modal view and not in the parent and provide the array as parameter to the modal view... Thanks!

    Read the article

  • JQuery: animate() doesn't work as expected in IE...

    - by swalkner
    Hi, I'm getting crazy with this IE 7... == hhttp://neu.emergent-innovation.com/ Why does following function not work in IE 7, but perfectly with Firefox? Is there a bug in the animate-function? function accordion_starting_page(){ // hide all elements except the first one $('#FCE-Inhalt02-ContentWrapper .FCE-Fade:not(:first)').css("height", "0").hide(); $('#FCE-Inhalt02-ContentWrapper .FCE-Fade:first').addClass("isVisible"); $('div.FCE-Title').click(function(){ // if user clicks on an already opened element => do nothing if (parseFloat($(this).next('.FCE-Fade').css("height")) > 0) { return false; } var toHide = $(this).siblings('.FCE-Fade.isVisible'); toHide.removeClass("isVisible"); // close all opened siblings toHide.animate({"height": "0", "display": "none"}, 1000); $(this).next('.FCE-Fade').addClass("isVisible").animate({"height" : "200"}, 1000); return false; }); } Thank you very much for your help...

    Read the article

  • Websphere/Oracle 11 - much more Heap Usage than with Oracle 10

    - by swalkner
    Hi all, while testing our application with Oracle 11 (previously, we had Oracle 10), we saw that our server uses much more heap space. It seems as it has something to do with T4CConnection; there are 500 objects of T4CConnection allocated. Someone told me, that Oracle 11 is using SoftReferences to keep the connection pool; but we don't need that. Is that correct? Could that be the problem for the increased heap space? If yes - how can we avoid connection pooling? Thanks a lot!!

    Read the article

  • Apple in-app-purchase ALWAYS with 30 % for Apple?

    - by swalkner
    Hi all, I know that Apple keeps 30 % of the money I make with in-app-purchase. But does that always count? I mean, if there's a feature allowing the user to buy something with an SMS-message, is that allowed? If yes, does Apple also keep 30 % then? Or if I make a WebService-call with username/password and return something to the user then, is it possible to charge that call and keep the money for myself? I thougt that those are options which are not allowed, but there are some apps out there which exactly do it that way - are they only "lucky" and Apple didn't see that or is it allowed to sell services that way? Thanks a lot for your answers, Stefan

    Read the article

1