我需要将应用程序分发给未指定数量的测试人员.我目前不知道有多少人想要访问,因此没有他们的UDID.根据我对此主题的了解,您需要创建一个签名到设备(或包含设备的配置文件)的IPA,允许访问它,或类似的东西?
我的问题是,您可以在创建IPA后将设备添加到IPA吗?
我打算创建一个分发网站,并在收到ID时添加设备.如果我能帮助它,我不想每次都重新创建IPA.
我真的以我的智慧结束了这一点.我不明白为什么它不起作用.
我创建了一个类,我使用rake命令调用并排队.当我使用'rake jobs:work'运行worker并调用命令'rake get_updates'时,它执行正常.
但是,当我将worker作为守护进程运行(RAILS_ENV =生产bin/delayed_job start)并调用命令'rake get_updates'时会产生错误.
应用程序/工人/ get_updates.rb
class GetUpdates
def perform
beginning = Time.now
include SoapHelper
require 'nokogiri'
require 'activerecord-import'
product_count = 0
contloop = true
while(contloop == true) do
@xml = Nokogiri::XML(get_unsent_data())
@guid = @xml.xpath('.//Message').attr("Id")
bulkUpdates = []
if (@xml.xpath('.//Product').count > 0)
@xml.xpath('.//Product').each do |p|
product_count += 1
update = Update.new
update.update_type = p.attr("UpdateType")
codes = Hash.new
p.children().each do |info|
info.xpath('.//ProductCodes/Code').each do |coco|
codes[coco.attr("Scheme").to_s] = coco.content
end
update.data = p.children().to_xml.to_s
end
bulkUpdates << update
end
if …Run Code Online (Sandbox Code Playgroud) 我目前的背景队列运气不好.我正试图让Resque工作.我已经安装了redis和Resque gem.
Redis正在运行.一个工人正在运行(rake resque:work QUEUE = simple).使用Web界面,我可以看到工作人员正在运行并等待工作.
当我运行'rake get_updates'时,作业排队但失败了.我已经尝试过def self.perform和def perform.
clockwork.rake
task :get_updates => :environment do
Resque.enqueue(GetUpdates)
end
Run Code Online (Sandbox Code Playgroud)
类文件(app/workers/get_updates.rb)
class GetUpdates
@queue = :simple
def perform
puts "Running GetUpdates"
end
end
Run Code Online (Sandbox Code Playgroud)
错误信息
undefined method `perform' for GetUpdates:Class
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/bundler/gems/resque-620d354454b8/lib/resque/job_performer.rb:79:in `perform_job'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/bundler/gems/resque-620d354454b8/lib/resque/job_performer.rb:46:in `execute_job'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/bundler/gems/resque-620d354454b8/lib/resque/job_performer.rb:25:in `perform'
Run Code Online (Sandbox Code Playgroud) 我正在利用一种技术来制作"响应式"电子邮件,其中包含两个版本.一个明确写的桌面和一个写的移动.使用条件语句和CSS(mso-hide:all; display:none;)的组合来隐藏桌面客户端中的移动版本,反之亦然.
这非常有效,并且符合预期.当我转发或回复其中一封电子邮件时,样式会中断并显示之前隐藏的"移动"版本.我尝试在表上使用内联样式(mso-hide:all; display:none;),以及应用类和使用条件注释以CSS方式应用相同的样式,但它不起作用.
我举一个例子,但工作相当敏感.
基本上,我正在寻找一种方法来隐藏Outlook中的表,并在回复/转发电子邮件时保持隐藏状态.
我有一个包含200,000个项目的JSON对象.我需要迭代这些对象,并确定它们是否存在并执行相关操作(插入/更新/删除).这个shell如下所示.当然,它实际上并没有保存任何东西.更多的是看这种方式需要多长时间.考虑到甚至还没有发生任何变化,这个动作在iPhone 4上处理大约需要8分钟,看起来很疯狂.
有没有更有效的方法来处理这个?
任何建议或指示将不胜感激.
- (void) progressiveInsert
{
prodAdd = 0;
prodUpdate = 0;
prodDelete = 0;
dispatch_queue_t backgroundDispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
dispatch_async(backgroundDispatchQueue,
^{
_productDBCount = 0;
NSLog(@"Background Queue");
NSLog(@"Number of products in jsonArray: %lu", (unsigned long)[_products count]);
NSManagedObjectContext *backgroundThreadContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSConfinementConcurrencyType];
[backgroundThreadContext setPersistentStoreCoordinator:_persistentStoreCoordinator];
[backgroundThreadContext setUndoManager:nil];
[fetchRequest setPredicate:predicate];
[fetchRequest setEntity:[NSEntityDescription entityForName:@"Products" inManagedObjectContext:_managedObjectContext]];
[fetchRequest setIncludesSubentities:NO]; //Omit subentities. Default is YES (i.e. include subentities)
[fetchRequest setFetchLimit:1];
[_products enumerateObjectsUsingBlock:^(id product, NSUInteger idx, BOOL *stop) {
predicate = [NSPredicate predicateWithFormat:@"code == %@", …Run Code Online (Sandbox Code Playgroud) 我正在构建的应用程序包含数千个项目的目录,这些项目需要存储在手机上.目前我通过CoreData实现这一目标,从逻辑上讲,它似乎是最好的地方.我正在使用GCD在后台运行CoreData插入流程并显示进度条/当前百分比完成情况.这可以按预期工作,但是对于仅5000件物品,在iPhone 4上完成需要8分钟.该应用程序将在3GS及更高版本上使用,并且一旦启动就更有可能包含30/40,000件物品.因此,这个处理时间将非常长.
有什么方法可以使用CSV文件或其他东西进行搜索,而不是将每个项目存储在CoreData中?我假设这样的方法有一些效率下降,但它会减轻过多的等待时间.除非有另一种解决方案可以帮助解决这个问题.
谢谢.
编辑:我不确定如何在整个操作结束时保存上下文,因为它在循环中使用单独的上下文.对此的任何建议将非常感谢.我不知道如何进步.
正在使用插入代码
- (void) processUpdatesGCD {
NSArray *jsonArray=[NSJSONSerialization JSONObjectWithData:_responseData options:0 error:nil];
NSArray *products = [jsonArray valueForKey:@"products"];
NSArray *deletions;
if ([jsonArray valueForKey:@"deletions"] == (id)[NSNull null]){
self.totalCount = [products count];
} else {
deletions = [jsonArray valueForKey:@"deletions"];
self.totalCount = [products count] + [deletions count];
}
self.productDBCount = 0;
_delegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *managedObjectContext = _delegate.managedObjectContext;
self.persistentStoreCoordinator = [managedObjectContext persistentStoreCoordinator];
_managedObjectContext = managedObjectContext;
// Create a new background queue for GCD
dispatch_queue_t backgroundDispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); …Run Code Online (Sandbox Code Playgroud) ios ×3
iphone ×3
ruby ×2
core-data ×1
daemon ×1
delayed-job ×1
email ×1
html ×1
html-email ×1
ios6 ×1
objective-c ×1
outlook ×1
resque ×1