English 中文(简体)
我如何检验核心数据迁移是否正在使用临时性建筑?
原标题:How do I test whether core data migration is working using adhoc builds?

我把我使用移民的用意混为一谈,例如:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
                         [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
                         [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];

What I want to do now is create an ad hoc build and test it on my devices.

通常,我会删除投影机,删除我的装置上的 app,然后将新建筑投放到护堤,然后把新建筑复制到我的装置上。

但是,为了检验移民情况,我想要老的 d留在这个装置上。 我应如何这样做?

最佳回答

The best way of updating ad hoc builds is by using a third party tool called TestFlight. It allows you to monitor crash reports and installations of builds and remotely and you don t need iTunes. It s great because each use of your app just updates the app instead of deleting it each time.

我如何向临时建筑提供最新情况?

问题回答

This is quite simple - once you know where to look.# In your AppDelegate you set-up the NSPersistentStoreCoordinator - and you need to add some options to this to tell it to handle auto-migrate:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:

[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,

[NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];

NSError *error;
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]];

if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType        configuration:nil URL:storeUrl options:options error:&error]) {
      // Handle error
    NSLog(@"Problem with PersistentStoreCoordinator: %@",error);
}

然后,你需要做:

  1. Select your xcdatamodeld file
  2. Select the Editor Menu at the top - then choose Add Model Version
  3. Now your xcdatamodeld file have two (modelname.xcdatamodel & modelname2.xcdatamodel ) .
  4. Now modelname.xcdatamodel have the green check mark implies it is current version, but we need to change the modelname2.xcdatamodel as a current version
  5. Select the xcdatamodeld file and then select the View Menu at the top - then Choose Utilities - then Choose the Show File Inspector is shown in right side of Xcode and then Select the Versioned Core Data Model - have Current(DropDownList) - select modelname2(the one you just made current version have green check mark).
  6. Now when you install this version onto a device that has the old model - it will automatically upgrade that model to the new model.

保存所有经修改的档案,然后,一旦你准备部署最新消息,你就会删除所有内部档案,并用最老和最新的模式进行部署。 反之亦然(4,5,6)

不要去掉从Stephen和你的器具上的照片,然后把新建筑交给Stor,然后把新建筑复制到你的装置。 现在,新版本的更新与新版本的更新相比,总是保持[双向版本,短]。 我已经进行了试验飞行。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签