iPhone开发【二十六】数据持久化总结之第5篇—CoreData技术

Weblogic负载均衡/Session复制之集群架构续 weblogic.management.DeploymentException: [HTTP Session:100039]Replicated HTTP sessions were specified for the Web application: proxy, but clustering was not enabled. 不同机器的处理 导出Domain,再导入Domain ... 阅读详情

转载请注明出处,原文网址:http://blog.youkuaiyun.com/m_changgong/article/details/8435094 作者:张燕广

实现的功能:1)演示使用CoreData持久化数据(仅显示基本操作,不包括很多复杂的操作)。

关键词:数据持久化 CoreData

1、新建一空工程,命名为:Persistence_CoreData:


2、选中“Use Core Data”后创建的工程中,AppDelegate.h中多了三个property,如下:

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

//备注1
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;

@end
代码解释
//备注1
NSManagedObjectContext:相当于数据库操作
NSManagedObjectModel:相当于数据库中的表及它们之间的关系
persistentStoreCoordinator:相当于数据库存放方式
以上比较不一定准确,但是可以更容易理解CoreData的应用。
3、AppDelegate.m中多了三个方法,如下:
#import "AppDelegate.h"
#import "ViewController.h"
@implementation AppDelegate

@synthesize managedObjectContext = _managedObjectContext;
@synthesize managedObjectModel = _managedObjectModel;
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    //设置根视图控制器
    self.window.rootViewController = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Saves changes in the application's managed object context before the application terminates.
    [self saveContext];
}

- (void)saveContext
{
    NSError *error = nil;
    NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
    if (managedObjectContext != nil) {
        if ([managedObjectContext hasChanges] && ![managedObjectContext save:&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. 
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            abort();
        } 
    }
}

//备注2
#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 from the application's model.
- (NSManagedObjectModel *)managedObjectModel
{
    if (_managedObjectModel != nil) {
        return _managedObjectModel;
    }
    NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Persistence_CoreData" withExtension:@"momd"];
    _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
    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 = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Persistence_CoreData.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. 
         
         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.
         
         
         If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory.
         
         If you encounter schema incompatibility errors during development, you can reduce their frequency by:
         * Simply deleting the existing store:
         [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]
         
         * Performing automatic lightweight migration by passing the following dictionary as the options parameter:
         @{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES}
         
         Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details.
         
         */
        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        abort();
    }    
    
    return _persistentStoreCoordinator;
}

#pragma mark - Application's Documents directory

// Returns the URL to the application's Documents directory.
- (NSURL *)applicationDocumentsDirectory
{
    return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}

@end
//备注2
//这三个方法,对应返回备注1中声明的3个变量
4、新建视图控制器ViewController(带xib)


修改AppDelegate.m中- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
设置根视图控制器
5、修改ViewController.xib,如下:

6、修改Persistence_CoreData.xcdatamodeld,添加Entity,名称为User,如下

7、修改ViewController,ViewController.h如下:
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@interface ViewController : UIViewController{
    AppDelegate *appDelegate;
}

@property(strong,nonatomic)IBOutlet UITextField *serverIp;
@property(strong,nonatomic)IBOutlet UITextField *userName;
@end
ViewController.m如下:
#import "ViewController.h"
#import "AppDelegate.h"

@interface ViewController ()

@end

@implementation ViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    //获取App代理
    appDelegate = [[UIApplication sharedApplication] delegate];
    
    //订阅通知
    UIApplication *app = [UIApplication sharedApplication];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:) name:UIApplicationWillResignActiveNotification object:app];
    
    [self loadData];
}

//加载数据
-(void)loadData{
    //1)获取托管对象上下文(相当于数据库操作)
    NSManagedObjectContext *context = [appDelegate managedObjectContext];//备注3
    //2)创建NSFetchRequest对象(相当于数据库中的SQL语句)
    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    //3)创建查询实体(相当于数据库中要查询的表)
    NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"User" inManagedObjectContext:context];
    //设置查询实体
    [request setEntity:entityDescription];
    //4)创建排序描述符,ascending:是否升序(相当于数据库中排序设置)。此处仅为演示,本实例不需要排序
    NSSortDescriptor *sortDiscriptor = [[NSSortDescriptor alloc] initWithKey:@"userName" ascending:NO];
    NSArray *sortDiscriptos = [[NSArray alloc] initWithObjects:sortDiscriptor, nil];
    [request setSortDescriptors:sortDiscriptos];
    //5)创建查询谓词(相当于数据库中查询条件) 此处仅为演示,本实例不需要查询条件
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"(serverIp like %@)",@"192"];
    [request setPredicate:pred];
    
    NSError *error;
    NSArray *objects = [context executeFetchRequest:request error:&error];
    if(objects == nil){
        NSLog(@"There has a error!");
        //做错误处理
    }else{
        if([objects count]>0){
            NSManagedObject *oneObject = [objects objectAtIndex:0];
            NSString *serverIp = [oneObject valueForKey:@"serverIp"];
            NSString *userName = [oneObject valueForKey:@"userName"];
            self.serverIp.text = serverIp;
            self.userName.text = userName;
        }    
    }
}

//应用界面退出时,保存数据
-(void)applicationWillResignActive:(NSNotification *)notification{
    NSLog(@"applicationWillResignActive");
    //创建托管对象上下文
    NSManagedObjectContext *context = [appDelegate managedObjectContext];
    NSFetchRequest *request = [[NSFetchRequest alloc]init];
    NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"User" inManagedObjectContext:context];
    [request setEntity:entityDescription];
    
    NSManagedObject *user = nil;
    NSError *error;
    NSArray *objets = [context executeFetchRequest:request error:&error];
    if(objets==nil){
        NSLog(@"There has a error!");
        //做错误处理
    }
    
    if([objets count]>0){
        //非第一次,更新数据
        NSLog(@"更新操作");
        user = [objets objectAtIndex:0];
    }else{
        NSLog(@"插入操作");
        //第一次保存,插入新数据
        user = [NSEntityDescription insertNewObjectForEntityForName:@"User" inManagedObjectContext:context];
    }
    
    [user setValue:self.serverIp.text forKeyPath:@"serverIp"];
    [user setValue:self.userName.text forKeyPath:@"userName"];
    
    [context save:&error];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
//备注3
//通过 delegate调用方法managedObjectContext,得到NSManagedObjectContext对象,
//NSManagedObjectContext对象会跟NSPersistentStoreCoordinator对象交互,NSPersistentStoreCoordinator对象负责处理底层的存储,sqlite3数据库名称默认为工程名称,Persistence_CoreData.sqlite
8、CoreData使用的数据库存储的位置是:
/Users/duobianxing/Library/Application Support/iPhone Simulator/5.0/Applications/BCCE1DDC-F50F-4A52-9678-991AC6DFBC7C/Documents
虽然该博文演示的创建“Use Core Data”的工程,其实只要搞明白选中“Use Core Data”后该工程模板都添加了哪些内容以及其作用?那么在一个已存在的工程(没有使用CorData)的加入CoreData的支持也非常方便。
下一篇将IOS中5种数据持久化的技术稍作对比,做个小结。
如何浏览与下载全球免费的地图高分辨率(亚米级)的遥感影像? 前言 如果你想使用商业卫星的高分辨遥感影像,一般价格昂贵。我们可以使用地图平台上免费的高分辨率数据。目前数据源很多,比如说google earth、天地图、四维地球、必应地图等等。这些影像统一有一个共同点就是:RGB三波段;Web地图瓦片服务。这意味着我们可以通过瓦片服务下载影像,但下载的影像只有三个波段,分别是 一.引言 二、可使用高分辨率的地图数据源 1.Google Earth影像 2.Esri World Image 3.天地图 4.必... 阅读详情

相关推荐

基于mediapipe的动作捕捉和unity的人物模型驱动

用到的人体关键点检测的算法是Google开发的基于深度学习的实时多媒体套件,汇集了人体、手部、人脸关键点追踪、物体检测、物体识别等多个流行的视觉任务的成果。整套 Mediapipe正如其名字,专门为便携设备上的多媒体应用设计,模型非常小,在笔记本手机上也能实时跑,跨平台、跨语言。mediapipe实时性是没什么问题。但是是以牺牲了质量为代价的,这种关键点检测一般是用来做动作识别,类似于运动app跳绳计数、判定瑜伽动作标不标准这种。用单目视觉来做人物模型的驱动,总差点意思。

qq_58484580的博客 5727

掌握文件协调的艺术:深入解析NSFileCoordinator

是一个用于管理和协调对文件系统进行读写操作的类。它允许开发者在多线程应用程序中安全地访问文件,而不必担心数据竞争或不一致的问题。通过使用,开发者可以确保文件操作的原子性,即使在多个进程或线程尝试同时访问同一文件时也能正常工作。

2401_85842555的博客 874

R 绘制环形树状图

按大类小类的从属关系绘制环形图,并把不同值的节点设置为相应大小。要求同一类的节点应为同一颜色。 按照输入,处理代码和输出记录

weixin_43718786的博客 1872

SwiftUI File Coordinators 使用教程

尽管进行了沙箱处理,但文件还可以通过多种方式共享给其他的应用程序使用。例如,您可以允许“Files”应用查看您的“文档”目录。为了提高访问的安全邢,我们可以使用NSFileCoordinator进行读取和写入。 推荐文章 SwiftUI之App目录结构大揭秘(数据到底应存在哪) SwiftUI读写文件基础操作,解决文件存储问题 测试class class Person: NSO...

iCloudEnd的博客 988

Voxel Hashing技术解析:如何解决TSDF内存爆炸问题?

本文深入解析Voxel Hashing技术如何有效解决TSDF内存爆炸问题。通过动态内存分配和空间哈希函数设计,该技术将内存占用降低96.6%,同时保持高精度重建。文章详细介绍了GPU加速实现、现代系统演进及实践指南,为实时3D重建提供工程解决方案。

m2n3b4v5c6的博客 713

java对接海康实现页面实时播放和回放

前言:之前已经写过一篇关于视频的文章,因为觉得有很多优化的地方,也谢谢同行们加我微信跟我提了一些需求和意见,所以在过年的假期重新写了一个比较能扩张的版本。 上一个版本的连接:https://blog.youkuaiyun.com/weixin_45848110/article/details/119363602 与之前的版本不同之处: 1.不需要安装ffmpeg 2.不需要安装nginx 3.直接运行jar即可 4.之前是完全脱离海康sdk,回放的录像是保存到本地服务,现在是直接在海康硬盘录像机获取录像回放 5.实时播

weixin_45848110的博客 1万+

[iOS]从系统“文件”APP选择文件上传以及保存文件到“文件”APP

#import "ViewController.h" @interface ViewController () <UIDocumentPickerDelegate> @property (nonatomic, strong) UIDocumentPickerViewController *documentPickerVC; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad].

Gamin 1万+

SAP SEGW 事物码里的 Function Import

开放数据协议(OData)包括标准的 CRUD (创建、检索、更新和删除)操作,这些操作映射到 HTTP 方法的 POST、GET、PUT/MERGE 和 Delete 几类。此外,OData还支持进一步的服务操作:,这些操作可以由HTTP方法GET或POST调用,用于处理不能映射到标准 CRUD 操作的任何内容。通过在数据模型中创建 ,可以在 service Builder 中实现此类额外的服务操作。例如,您可以为以下自定义操作创建函数导入:Work Item confirmation检查航班的可用性虽然

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 991

weblogic session复制

在Weblogic中,HttpSession Replication的方式是通过在weblogic.xml中的session- descriptor的定义persistent-store-type来实现的. persistent-store-type可选的属性包括memory, replicated, replicated_if_clustered, async-replicated, async

tomcat_baby的专栏 1495

国科大学习资料--模式识别与机器学习(黄庆明)--2020期末考试题

国科大学习资料–模式识别与机器学习(黄庆明)–2020期末考试题 国科大学习资料–模式识别与机器学习(黄庆明)–2020期末考试题 国科大学习资料–模式识别与机器学习(黄庆明)–2020期末考试题 ============================================================================================================================================================

无名何许人的博客 2600

RK3588 ENV 环境配置之 fw_printenv

RK3588 ENV环境配置指南 本文详细介绍了在RK3588平台上配置ENV环境变量的完整流程。首先需要在parameter分区表中划分env分区,然后在U-Boot中配置MMC偏移地址。接着编译fw_printenv工具并部署到目标设备,配置fw_env.config文件指定存储位置。重点解决了内核中读写ENV时遇到的CRC校验问题,通过U-Boot的saveenv命令初始化环境变量存储区域。最后展示了如何使用fw_printenv/fw_setenv工具在内核中读写ENV变量,并建议将配置集成到根文件

501846585_QQAndroid_java 1031

CoreData

1. 创建Data Model 鼠标右键弹出菜单,选择New File,再选择Core Data下的Data Model,创建xcdatamodeld类型的文件 Data Model中,点击Add Entity按钮,创建新的Entity,并在Attributes下设置属性 2. 创建上下文 导入库和设置属性 #import <CoreData/CoreData.h> @proper...

钻石星辰的专栏 225

【法如faro】三维激光软件Scene2023数据处理(自动配准并转换坐标)流程

法如faro Scene2023数据处理(自动配准并转换坐标)的主要流程为:新建项目、导入数据、处理、自动注册、坐标系转换、模型导出立和面模型导出等。

智慧空间实验室 2382

iPhone开发【二十七】数据持久化总结之第6篇(终结篇)—5种数据持久化方法对比总结

本篇对IOS中常用的5种数据持久化方法进行简单对比总结 第1种:UserDefaults(iPhone开发【二十】数据持久化总结之第1篇—NSUserDefaults) 1)易用性很强 2)数据存储在.plist文件中 3)一般保存首选项信息、缓存数据等,适用存储较少量数据的情况 4)缺点:无法将自定义对象序列化到属性列表中 第2种:属性列表(iPhone开发【二十一】数据持久化总结之

长弓的专栏 4950

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

iPhone开发 数据持久化总结(终结篇)—5种数据持久化方法对比

iPhone开发 数据持久化总结(终结篇)—5种数据持久化方法对比 iphoneiPhoneIPhoneIPHONEIphone数据持久化 对比总结 本篇对IOS中常用的5种数据持久化方法进行简单对比总结 第1种:UserDefaults(iPhone开发【二十】数据持久化总结之第1篇—NSUserDefaults) 1)易用性很强 2)数据存储在.plist文件中 3)一般...

weixin_30726161的博客 178

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

iPhone开发数据持久化总结之第6篇(终结篇)—5种数据持久化方法对比总结 .

本篇对IOS中常用的5种数据持久化方法进行简单对比总结 第1种:UserDefaults(iPhone开发【二十】数据持久化总结之第1篇—NSUserDefaults) 1)易用性很强 2)数据存储在.plist文件中 3)一般保存首选项信息、缓存数据等,适用存储较少量数据的情况 4)缺点:无法将自定义对象序列化到属性列表中 第2种:属性列表(iPhone开发【二十...

阿弥陀佛 166

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

[转]iOS IPC via NSFileCoordinator and NSFilePresenter

Source:http://mjtsai.com/blog/2014/11/21/ios-ipc-via-nsfilecoordinator-and-nsfilepresenter/为什么每次我想到的东西,别人都已经研究了。⊙﹏⊙b汗Tom Harrington:There’s still no full IPC mechanism on iOS.NSDistributedNotificatio...

weixin_30819085的博客 335

ios中的coredata的使用

Core Data数据持久化是对SQLite的一个升级,它是ios集成的,在说Core Data之前,我们先说说在CoreData中使用的几个类。    (1)NSManagedObjectModel(被管理的对象模型)            相当于实体,不过它包含 了实体间的关系     (2)NSManagedObjectContext(被管理的对象上下文)      

Mirage520的专栏 808

CoreData使用笔记 之 增删改查

用惯了FMDB,好多小伙伴问我为什么bu'yong

万花筒 邪灵噶 的博客 1438

设置ear中war之间session共享

设置ear中war之间session共享 由J2EE Servlet规范中,可以知道,正常情况下war之间session是彼此独立的,不可以共享的。 但是现在大部分J2EE服务器,都实现了EAR中war之间的session共享,如weblogic(>=9)、websphere。 设置weblogic的EAR中war之间session共享有下面两种方法: 1:设置EAR中的weblogic-

gaohaiyang的专栏 3134

weblogic集群session共享

(一)第一种方式在weblogic.xml中 &lt;session-descriptor&gt;          &lt;persistent-store-type&gt;replicated&lt;/persistent-store-type&gt;          &lt;sharing-enabled&gt;true&lt;/sharing-enabled&gt; &lt;/sessi...

稻香 1830

iOS进阶第三节 数据处理之CoreData

一、CoreData数据库框架的优势 1>. CoreData历史 CoreData数据持久化框架是Cocoa API的一部分,首次在iOS5版本的系统中出现,它允许按照 实体 - 属性 - 值 模型组织数据,并以XML、二进制文件或者SQLite数据文件的格式持久化数据 CoreData主要提供 对象 - 关系映射(ORM)功能,把OC对象转化为数据保存到文件,也可以数...

weixin_30686845的博客 167

Core Data的理解

一、基础概念深入 1.NSManagedObjectContext 被管理数据上下文就像便笺簿 当从数据持久层获取数据时,相当于把这些临时的数据拷贝写在便笺簿上,然后就可以随心所欲的修改这些值。 通过上下文,可以对数据记录NSManagedObject进行添加删除更改,记录更改后支持撤销和重做。 除非你保存这些数据变化,否则持久层的东西是不会变化。 通常我们将 controller...

不积跬步 无以至千里 不积小流 无以成江海 291
上一篇: iPhone开发【二十五】使用静态库—第1篇(使用Cocoa Touch Static Library模板)
下一篇: iPhone开发【二十七】数据持久化总结之第6篇(终结篇)—5种数据持久化方法对比总结
程序员长弓
博客等级 码龄20年 650粉丝 183原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值