AppStore评论员要求我们购买Non-renewing subscriptions类型不会强制用户注册.他还意味着用户没有注册他也可以购买Non-renewing subscriptions类型
而Apple Document要求Non-renewing subscriptions必须可以恢复.他说 :
Store Kit不会自动恢复非续订订阅和消耗品.但是,不续订订阅必须是可恢复的.要恢复这些产品,您必须在购买时在自己的服务器上记录事务,并提供自己的机制将这些事务还原到用户的设备.
所以当用户注册时,我会给用户一个唯一的userId,他可以用userName和密码获取userId,这样我就可以分享不同ios设备的用户信息,我可以恢复交易,因为他们有一个唯一的userId .
但问题是这样的:当用户没有注册时,我的服务器也会给他们一个唯一的userId,非注册用户会将userId保存到.plist.他们还可以恢复交易.但是当他删除我的应用程序,然后下载一次,userId就丢失了,所以他无法恢复交易.他将是一个普通的默认用户.
appStore会拒绝我的应用程序,原因如下:
无法在没有注册的情况下还原非续订订阅的事务,这会在还原之前删除应用程序
如果appStore会拒绝,如何修复它,thx all.
我收到了这个奇怪的错误.如果我查看cocoapod规范,这似乎是一个有效的语法.我究竟做错了什么.?
[!] Invalid `Podfile` file: undefined method `inherit!' for #<Pod::Podfile:0x007fad141d1050>. Updating CocoaPods might fix the issue.
# from /Users/Downloads/EarlGrey-master/Demo/EarlGreyExample/Podfile:28
# -------------------------------------------
# target TEST_TARGET do
> inherit! :search_paths
# pod 'EarlGrey'
Run Code Online (Sandbox Code Playgroud) 我一直在搞乱Leaks试图找到哪些功能没有被解除分配(我还是新手)并且可以真正使用一些经验丰富的见解.
我有一些似乎是罪魁祸首的代码.每次按下调用此代码的按钮时,都会向内存分配32kb的内存,当释放按钮时,内存不会被释放.
我发现每次AVAudioPlayer调用播放m4a文件时,解析m4a文件的最后一个函数就是MP4BoxParser::Initialize()通过它分配32kb的内存Cached_DataSource::ReadBytes
我的问题是,如何在完成后解除分配,以便每次按下按钮时都不会分配32kb?
非常感谢您提供的任何帮助!
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
//stop playing
theAudio.stop;
// cancel any pending handleSingleTap messages
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(handleSingleTap) object:nil];
UITouch* touch = [[event allTouches] anyObject];
NSString* filename = [g_AppsList objectAtIndex: [touch view].tag];
NSString *path = [[NSBundle mainBundle] pathForResource: filename ofType:@"m4a"];
theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio prepareToPlay];
[theAudio setNumberOfLoops:-1];
[theAudio setVolume: g_Volume];
[theAudio play];
}
Run Code Online (Sandbox Code Playgroud) 我正在创建一个应用程序,当按下按钮时可以播放声音,并使用可以调节音量的UISlider.有时音量太高,有时甚至在将iphone的音量增加到最大之后也会太低.我如何保持音量始终高?任何可能的方法来集成系统音量和滑块音量?使用MPVolumview会让我的应用程序被拒绝我猜...我在按钮触摸时使用的代码就是这个
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
resourcePath = [resourcePath stringByAppendingString:@"/sound.mp3"];
NSLog(@"Path to play: %@", resourcePath);
player = [[AVAudioPlayer alloc] initWithContentsOfURL:
[NSURL fileURLWithPath:resourcePath] error:&err];
player.delegate = self;
[player play];
player.volume=.50;
player.numberOfLoops=-10;
-(IBAction)slidervaluechanged
{ player.volume=slider.value; }
Run Code Online (Sandbox Code Playgroud)
}
我有一个外部应用程序将文件上传到我的rails web应用程序.(在Heroku上开发,但这并不完全相关)
我需要将该文件上传到AWS.我已经使用rails成功连接到AWS,但我无法弄清楚如何访问上传的文件.
我知道我需要做File.open({path to file}),然后将文件传递给AWS
有一个使用HAML的rails应用程序(3.0.9),本地开发服务器运行正常.但是当我运行rails s -e production时,我的页面会出现这个错误:
NoMethodError: undefined method `+@' for #<String:0x00000006331098>
Run Code Online (Sandbox Code Playgroud)
错误说它在这一行(从视图,用HAML编写):
%tr{:class=> cycle("even","odd")}
Run Code Online (Sandbox Code Playgroud)
我没有发现为什么会发生这种情况.请帮忙.
我正在转换一个标准的脚手架生成的应用程序,以类似于http://stjhimy.com/posts/07-creating-a-100-ajax-crud-using-rails-3-中指定的方式使用AJAX和JQuery.-unobtrusive-javascript.
我按照所有说明操作:
似乎无法访问js.erb文件.例如,将js.erb放在视图文件中app/views/customers/create.js.erb
create.js.erb的代码是:
<% if @customer.errors.any? -%>
/*Hide the Flash Notice div*/
$("#flash_notice").hide(300);
/*Update the html of the div customer_errors with the new one*/
$("#customer_errors").html("<% @customer.errors.full_message.each do |msg| %>
<li><%= msg %></li>
<% end %>");
/*Show the div customer_errors*/
$("#cust0mer_errors").show(300);
<% else -%>
/*Hide the div customer_errors*/
$("#customer_errors").hide(300);
/*Update the html of the div flash_notice with the new one */
$("#flash_notice").html("<%= flash[:notice] %>");
/*Show the flash_notice div*/
$("#flash_notice").show(300);
/*Clear the entire …Run Code Online (Sandbox Code Playgroud) 我正在制作一个电子商务应用程序,其中的类别在所有页面的侧栏中都可见.我在应用程序控制器中写了一个方法
def categories
@categories = Category.all
end
Run Code Online (Sandbox Code Playgroud)
但是我怎么能默认这个方法可用于所有控制器和动作,这样我就不必在每个动作中专门调用这个方法
def list
categories
@products = Product.order('title').page(params[:page]).per(4)
end
Run Code Online (Sandbox Code Playgroud) 首先,我使用的是来自github repo主分支的rails 3.1.3和carrierwave.
我使用after_init钩子来确定基于页面模型实例的属性的字段,并为这些字段定义属性访问器,将值存储在序列化哈希中(希望它清楚我在说什么).这是我正在做的一个精简版:
class Page < ActiveRecord::Base
serialize :fields, Hash
after_initialize :set_accessors
def set_accessors
case self.template
when 'standard'
class << self
define_method 'image' do
self.fields['image']
end
define_method 'image=' do |value|
self.fields['image'] = value
end
end
mount_uploader :image, PageImageUploader
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
省略mount_uploader命令可以让我访问我想要的属性.但是,当我挂载上传器时,会收到一条错误消息,提示"未定义的方法是新的nil类"
我在源代码中读到扩展模块中有read_uploader和write_uploader方法.我如何重写这些以使mount_uploader命令与我的'virtual'属性一起工作.
我希望有人知道如何解决这个问题.非常感谢你的帮助.
最良好的问候.多米尼克.
ruby metaprogramming ruby-on-rails carrierwave ruby-on-rails-3.1
Android 中的 content provider 相当于 iOS 中的什么?
概括:
内容提供商管理对中央数据存储库的访问。提供程序是 Android 应用程序的一部分,通常提供自己的 UI 来处理数据。然而,内容提供者主要供其他应用程序使用,这些应用程序使用提供者客户端对象访问提供者。提供商和提供商客户端共同提供一致的标准数据接口,该接口还可以处理进程间通信和安全数据访问。
文档: http ://developer.android.com/guide/topics/providers/content-providers.html
iphone ×3
ios ×2
ajax ×1
amazon-s3 ×1
android ×1
app-store ×1
carrierwave ×1
cocoapods ×1
global ×1
haml ×1
javascript ×1
jquery ×1
memory-leaks ×1
objective-c ×1
ruby ×1
view-helpers ×1
volume ×1