我在iphone上安装我的应用程序时遇到一些问题,因为我不断收到以下错误消息
该服务无效
请检查您的设置,然后重试
(0XE8000022)
它一直运行得很好,直到昨天,但从昨天起我遇到了这个问题.
我正在MKMapView使用通常的彩色针作为位置点.我希望能够在不触碰针的情况下显示标注.
我该怎么办?调用setSelected:YESannotationview什么也没做.我正在考虑模拟针上的触摸,但我不确定如何去做.
我正在开发一个我想要使用的应用程序NSDictionary.任何人都可以给我一个示例代码,解释如何使用NSDictionary一个完美的例子来存储数据的过程?
我是iPhone编程的新手
我想阅读我的Resourse文件夹中的文本文件的内容.我做了很多谷歌搜索,但没有得到正确的方法来完成这项任务.
请建议
有谁知道如何在iPhone应用程序中包含一个"按钮".我尝试在内部调用iframe,UIWebView但这不起作用.
我如何获得字节长度NSString?如果myString包含"hallo",myString.length将返回5,但是取了多少实际字节?
我正在制作一个计时器应用程序,需要向用户显示小时,分钟和秒.我尝试使用,UIDatePicker但它只显示小时和分钟作为选择.不是秒.在网上做了一些研究之后,我发现没有办法获得秒数UIDatePicker,我不得不UIPickerView从头开始编写自己的.
所以我的问题是,是否有这样的示例代码,即有人写了CustomUIPickerView几个小时,分钟和秒,我可以在我的项目中加入?UIDatePicker有一个很好的覆盖时间和分钟文本,在用户旋转拨号时保持放置.如果有人在他们的自定义选择器中添加它会很好.UIPickerView如果我不需要,我不想从头开始编写自定义.谢谢.
我不知道这段代码有什么问题,但每当我运行应用程序时,在显示菜单后,应用程序崩溃.
NSString * path = [[NSBundle mainBundle] pathForResource:@"tung" ofType:@"doc"];
UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
docController.delegate = self;
//[docController presentPreviewAnimated:YES];
CGRect rect = CGRectMake(0, 0, 300, 300);
[docController presentOptionsMenuFromRect:rect inView:self.view animated:YES];
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
***由于未捕获的异常'NSGenericException'终止应用程序,原因:' - [UIPopoverController dealloc]到达,而popover仍然可见.
我现在应该怎么做 ?
当我使用此代码创建字符串的sha256时
unsigned char hashedChars[32];
NSString *inputString;
inputString = [NSString stringWithFormat:@"hello"];
NSData * inputData = [inputString dataUsingEncoding:NSUTF8StringEncoding];
CC_SHA256(inputData.bytes, inputData.length, hashedChars);
Run Code Online (Sandbox Code Playgroud)
它正确地返回哈希,但是我需要插入一个类似于\ x00\x25\x53的字符串,在这种情况下,该函数返回一个空字符串的sha256,因为指定的编码不能用于转换接收器.
现在,我的问题是:如何插入此特殊字符以生成正确的哈希?谢谢
我已使用以下代码从图像成功创建了视频
-(void)writeImageAsMovie:(NSArray *)array toPath:(NSString*)path size:(CGSize)size duration:(int)duration
{
NSError *error = nil;
AVAssetWriter *videoWriter = [[AVAssetWriter alloc] initWithURL:
[NSURL fileURLWithPath:path] fileType:AVFileTypeQuickTimeMovie
error:&error];
NSParameterAssert(videoWriter);
NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
AVVideoCodecH264, AVVideoCodecKey,
[NSNumber numberWithInt:size.width], AVVideoWidthKey,
[NSNumber numberWithInt:size.height], AVVideoHeightKey,
nil];
AVAssetWriterInput* writerInput = [[AVAssetWriterInput
assetWriterInputWithMediaType:AVMediaTypeVideo
outputSettings:videoSettings] retain];
AVAssetWriterInputPixelBufferAdaptor *adaptor = [AVAssetWriterInputPixelBufferAdaptor
assetWriterInputPixelBufferAdaptorWithAssetWriterInput:writerInput
sourcePixelBufferAttributes:nil];
NSParameterAssert(writerInput);
NSParameterAssert([videoWriter canAddInput:writerInput]);
[videoWriter addInput:writerInput];
//Start a session:
[videoWriter startWriting];
[videoWriter startSessionAtSourceTime:kCMTimeZero];
CVPixelBufferRef buffer = NULL;
buffer = [self pixelBufferFromCGImage:[[array objectAtIndex:0] CGImage]];
[adaptor appendPixelBuffer:buffer withPresentationTime:kCMTimeZero];
//Write samples:
for (int i = …Run Code Online (Sandbox Code Playgroud) iphone ×10
objective-c ×4
ios ×2
xcode ×2
avfoundation ×1
button ×1
document ×1
facebook ×1
file ×1
hash ×1
installation ×1
ios5 ×1
ipad ×1
nsdictionary ×1
nsstring ×1
sha256 ×1
text ×1