Tag: logging

是否有一个iOS录音机框架录制演示?

我想在设备上logging我的应用程序演示。 为了logging应用程序演示的目的,是否有框架可以放入应用程序来logging屏幕? 当然这个框架将在提交到App Store之前被删除。

修复bug:date值在iPhone中可用,但不能在iPad上使用

在我的应用程序中,我必须显示一个星期的date值。它在iPhone上正常工作,但不是在iPad上。 1.此图像显示iPhone中文本框上方的date值(21 … 27) 2.此图片显示iPad中文本框上方的错误date值(3)。 对于这个我的一段代码: – (void)viewDidLoad { [super viewDidLoad]; // here the self.startday value has been passed from one controller to another. _datelabel.text = self.startday; // here the self.startday =@"2016-02-23" [self method1]; [self getdateArray]; [self method2]; } 我的一段代码获取date: -(void) get date { NSString *dateStr,*strday; NSString *dateFormat=@"yyyy-MM-dd"; NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init]; [dateFormatter1 […]

带有MagicalRecord巨大数据集的UItableView

我有一个表存储一些数据。 假设数据太大,无法一次加载到内存中。 我想在UItableView中显示这些数据。 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [Item MR_numberOfEntities]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; // How to get object for this row ??? return cell; } 我知道的唯一方法是将所有数据加载到数组中 NSArray *items = [Item MR_findAll]; 但我不想这样做。 用户将显示前10行,为什么我应该从CoreData加载它们。 有什么办法使用MagicalRecord一个接一个地取出它们吗?

IOS的神奇logging创build新的实体,并添加到arrays不woking

嗨,我正在与核心数据和魔法logging。 从服务器收到JSON响应之后。 我想创build一个实体,更新它的属性并添加到数组中。 我的代码是 NSMutableArray *items = [NSMutableArray array]; NSManagedObjectContext *localContext = [NSManagedObjectContext MR_context]; Article *article = [Article MR_createEntityInContext:localContext]; [article setOrderingValue:idx]; [article updateWithApiRepresentation:articleJSON]; [items addObject:article]; 我不知道为什么上述不工作(不返回正确的项目数组)。 如果我更换这条线,这只是工作 Article *article = [Article MR_createEntityInContext:localContext]; 用这条线 Article *article = [[Article alloc] initWithEntity:[Article entityInManagedObjectContext:localContext] insertIntoManagedObjectContext:nil]; 主要目的是返回正确的items数组。 任何帮助非常感谢。 谢谢

iOS从数组中导入魔法logging

您好我正在做一个同步function,更新数据库时,从服务器接收JSON响应。 我想导入只发生,如果有不同的数据(新的logging或更新现有的logging)(以提高性能)(使用coredata和magicalRecord ) 这是我的JSONparsing器方法 – (void)updateWithApiRepresentation:(NSDictionary *)json { self.title = json[@"Name"]; self.serverIdValue = [json[@"Id"] integerValue]; self.year = json[@"Year of Release"]; self.month = json[@"Month of Release"]; self.day = json[@"Day of Release"]; self.details = json[@"Description"]; self.coverImage = json[@"CoverImage"]; self.thumbnail = json[@"Thumbnail"]; self.price = json[@"Buy"]; NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"dd/MMMM/yyy"]; NSDate *date = [formatter dateFromString:[NSString stringWithFormat:@"%@/%@/%@",self.day,self.month,self.year]]; […]

使用核心数据和魔法logging创build一个实例variables

目前在一个给定的类中给定的方法,我可以创build一个由Core Data和Magical Recordpipe理的自定义variables的一个实例,下面的行 AViewController.m List *list = [List MR_createInContext:_managedObjectContext]; 然后我可以像这样设置列表的属性: list.name = @"FooBar Name"; 我的问题 :在AViewController.h我可以做到以下几点 – @interface AViewController : UIViewController { /* Define Local List Var for AViewController class */ List *list; } 然后在.m viewdidload { list = [List MR_createInContext:_managedObjectContext]; } someCustomMethod { list.name = @"FooBar Name"; [_managedObjectContext MR_save]; }

ios MagicalRecordsorting。 需要部分标题的列表

我有一个使用MagicalRecord访问的核心数据模型。 我使用这个代码来得到一个按类别sorting和分组的tableview: frc = [ListActivity MR_fetchAllSortedBy:@"activityCategory,activityName" ascending:YES withPredicate:nil groupBy:@"activityCategory" delegate:nil]; 生成的tableview如下所示: 在另一个视图中,我使用相同的数据,但是这次只需要一个由属性“activityCategory”表示的节标题列表。 我认为这是一件简单的事情,但并非如此。 这个代码,例如: frc = [ListActivity MR_fetchAllSortedBy:@"activityCategory" ascending:YES withPredicate:nil groupBy:nil delegate:nil]; 产生这个: 相反,我想要的只是一个类别列表(单数),在第一个例子中提供了部分标题的属性。 我试了几个其他的configuration,但是意识到我只是把东西扔在墙上,看它是否会粘住。 MagicalRecord的文档与框架一样出色,可惜的是缺乏。 有人可以指点我的解决scheme吗? 谢谢!

NSFetchedResultsController并获得分组的权利

我有以下问题。 我有一个由NSFetchedResultsController支持的UITableview。 它应该显示让我们说一个项目,文件夹和文件。 没有比这更大的等级。 所以一个项目有几个文件夹,并有几个文件。 现在我的表格视图应该显示这些文件,按文件夹分组。 所以我认为我的提取请求的谓词只是: [NSPredicate predicateWithFormat:@"folder.project = %@", self.project]; 然后我会使用MagicalRecord来创build一个NSFetchedResultsController: [File fetchAllGroupedBy:@"folder.name" withPredicate:sectionPredicate sortedBy:@"folder.name" ascending:YES]; 这基本上与一个大问题的工作…如果文件夹中没有文件,我不会得到该文件夹​​的一部分(我需要!!!!) 所以我需要的是tableview也显示空文件夹的部分标题: Folder A File 1 File 2 Folder B Folder C File 3 我可以做到这一点没有NSFetchedResultsController,但我喜欢它处理插入/删除行和部分如此好,它观察到的变化… Thx帮忙,干杯,Georg

在今天的扩展中创buildlogging时的更改和在应用中更新的logging在今天的扩展中是不可见的

只要我有一个应用程序,今天扩展。 另外我有两个实体: 目标和服务 。 @objc(Goal) class Goal: NSManagedObject { @NSManaged var identifier: String @NSManaged var startDate: Date @NSManaged var endDate: Date private var services: [Service] { let predicate = NSPredicate(format: "date >= %@ && date <= %@", startDate as NSDate, endDate as NSDate) return Service.mr_findAll(with: predicate) as! [Service] } var duration: Int64 { return services.reduce(0) […]

multithreading违反核心数据

我有一个应用程序,我在启动时使用操作列表下载数据,并随机崩溃,因为未知的核心数据原因,所以我花了几天的时间检查最佳实践,以使用MagicalRecord更新/获取multithreading核心数据中的数据。 其中一个选项是启用multithreadingdebugging器-com.apple.CoreData.ConcurrencyDebug 1 ,其中Xcode在违反其规则之一时停止应用程序。 所以,Xcode停止我的应用程序在这一行[SyncRequestEntity MR_createEntityInContext:[self getPrivateContext]] + (MagicalRecordVersionNumber) version { return MagicalRecordVersionNumber2_3; } @implementation NSManagedObjectContext (MagicalRecord) + (NSManagedObjectContext *) MR_context { return [self MR_contextWithParent:[self MR_rootSavingContext]]; } + (NSManagedObjectContext *) MR_contextWithParent:(NSManagedObjectContext *)parentContext { NSManagedObjectContext *context = [self MR_newPrivateQueueContext]; [context setParentContext:parentContext]; [context MR_obtainPermanentIDsBeforeSaving]; return context; } – (void) MR_obtainPermanentIDsBeforeSaving { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MR_contextWillSave:) name:NSManagedObjectContextWillSaveNotification object:self]; […]