我正在做一些数据写入我的文档目录,我想知道是否有办法告诉我的writeToFile方法何时完成,我创建的文件是否已完全创建.在此先感谢这里是我正在调用的方法我正在寻找一种方式,它是委托方法或其他方式告诉它何时完成.
[imageData writeToFile:fullPathToFile atomically:YES];
Run Code Online (Sandbox Code Playgroud)
缺口
有没有人知道一些开箱即用的库可能会提供相机抖动等效果SKNode?
如果没有,是否有一种简单的方法来实现使用动作的相机抖动?
谢谢
我的问题非常简单,根据苹果文档,您可以在呈现如下场景之前将纹理预加载到RAM中:
SKTextureAtlas * atlas = [SKTextureAtlas atlasNamed:@"effect_circle_explode"];
SKTextureAtlas * atlas2 = [SKTextureAtlas atlasNamed:@"box_explodes"];
SKTextureAtlas * atlas3 = [SKTextureAtlas atlasNamed:@"fence_new"];
SKTextureAtlas * atlas4 = [SKTextureAtlas atlasNamed:@"swipe"];
SKTextureAtlas * atlas5 = [SKTextureAtlas atlasNamed:@"coin"];
SKTextureAtlas * atlas6 = [SKTextureAtlas atlasNamed:@"two_times"];
SKTextureAtlas * atlas7 = [SKTextureAtlas atlasNamed:@"three_times"];
SKTextureAtlas * atlas8 = [SKTextureAtlas atlasNamed:@"gus"];
[SKTextureAtlas preloadTextureAtlases:@[atlas, atlas2, atlas3, atlas4, atlas5, atlas6, atlas7, atlas8] withCompletionHandler:^{
[moron_logo removeFromSuperview];
moron_logo = NULL;
stuff.hidden = NO;
store.hidden = NO;
scroll_view.userInteractionEnabled = YES;
[self present_game_view];
}];
Run Code Online (Sandbox Code Playgroud)
现在如果以后通过游戏玩法你会对同样的地图集进行预加载会产生任何负面影响:
-(void)load
{
SKTextureAtlas …Run Code Online (Sandbox Code Playgroud) 所以我在转换某些音频方面遇到了问题.我在转换时遇到了巨大的内存泄漏,它来自这些代码行.
dispatch_queue_t mediaInputQueue = dispatch_queue_create("mediaInputQueue", NULL);
[assetWriterInput requestMediaDataWhenReadyOnQueue:mediaInputQueue
usingBlock: ^
{
while (assetWriterInput.readyForMoreMediaData)
{
CMSampleBufferRef nextBuffer = [assetReaderOutput copyNextSampleBuffer];
if (nextBuffer)
{
[assetWriterInput appendSampleBuffer: nextBuffer];
nextBuffer = NULL;
}
else
{
// done!
[assetWriterInput markAsFinished];
[assetWriter finishWriting];
[assetReader cancelReading];
NSDictionary *outputFileAttributes = [[NSFileManager defaultManager]
attributesOfItemAtPath:exportPath
error:nil];
NSNumber *doneFileSize = [NSNumber numberWithLong:[outputFileAttributes fileSize]];
[self performSelectorOnMainThread:@selector(updateCompletedSizeLabel:)
withObject:doneFileSize
waitUntilDone:NO];
// release a lot of stuff
[assetReader release];
[assetReaderOutput release];
[assetWriter release];
[assetWriterInput release];
[exportPath release];
break;
}
}
}];
Run Code Online (Sandbox Code Playgroud)
似乎导致泄漏的行是:CMSampleBufferRef nextBuffer = [assetReaderOutput …
使用SpriteKit创建游戏并且它实际上运行得非常好.我正在使用物理学并且有能力实际看到我的身体在哪里,因为我可能在我的精灵中有一些alpha会真的很有帮助.这对于创建更精确的实体也很有帮助.
在SpriteKit的文档中,他们讨论了debugOverlay,但他们给出的唯一例子是绘制引力方向.这是链接:https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Actions/Actions.html
滚动到调试覆盖区域.
是否有人编写了一些代码,可以轻松访问场景中所有对象的主体并绘制它们的确切大小并将它们放在应该在相关性中的位置?我很惊讶苹果不仅仅在物理机构中添加了某种类型的DrawGizmos属性.
提前致谢.
问题是如何找到并移动记录在 iOS 设备上的 .mov 文件的 moov 原子,以便您可以通过 http 流式传输它。有一种方法可以做到这一点,但需要将其导出到文件,理论上这可以让您复制整个文件,然后您就可以流式传输它。
有没有其他方法可以做到这一点?
所以我想确切地确定这次崩溃的原因是什么.请在此处查看崩溃报告:
这是在日志中生成的:libc ++ abi.dylib:以std :: out_of_range类型的未捕获异常终止:vector
基本上崩溃不会一直发生,似乎发生在最近的iOS设备上.如果我清理我的构建,我注意到它发生的可能性要小得多.我假设它与我的纹理地图集有关?
有没有人有同样的问题,你做了什么来解决?需要指出正确的方向这里一直在做试验和错误一段时间没有我的所有纹理负载,但无法精确定位它.
提前致谢!
编辑:
-(void)load_engine
{
//general atlases
circle_explodes_atlas = [SKTextureAtlas atlasNamed:@"effect_circle_explode"];
box_explodes_atlas = [SKTextureAtlas atlasNamed:@"box_explodes"];
fence_atlas = [SKTextureAtlas atlasNamed:@"fence_new"];
swipe_atlas = [SKTextureAtlas atlasNamed:@"swipe"];
coin_atlas = [SKTextureAtlas atlasNamed:@"coin"];
reward2x_atlas = [SKTextureAtlas atlasNamed:@"two_times"];
reward3x_atlas = [SKTextureAtlas atlasNamed:@"three_times"];
healthpack_atlas = [SKTextureAtlas atlasNamed:@"healthpack_explodes"];
effects_atlas = [SKTextureAtlas atlasNamed:@"effect"];
//character atlases
broccoli_atlas = [SKTextureAtlas atlasNamed:@"broccoli"];
brussel_atlas = [SKTextureAtlas atlasNamed:@"brussels"];
corn_atlas = [SKTextureAtlas atlasNamed:@"corn"];
cucumber_atlas = [SKTextureAtlas atlasNamed:@"cucumber"];
eggplant_atlas = [SKTextureAtlas atlasNamed:@"eggplant"];
salad_atlas = [SKTextureAtlas atlasNamed:@"salad"];
peas_atlas = [SKTextureAtlas atlasNamed:@"peas"]; …Run Code Online (Sandbox Code Playgroud)