小编Atu*_*ain的帖子

错误:服务无效

我在iphone上安装我的应用程序时遇到一些问题,因为我不断收到以下错误消息

该服务无效

请检查您的设置,然后重试

(0XE8000022)

它一直运行得很好,直到昨天,但从昨天起我遇到了这个问题.

iphone installation objective-c

145
推荐指数
3
解决办法
4万
查看次数

如何在不触及引脚的情况下触发MKAnnotationView的标注视图?

我正在MKMapView使用通常的彩色针作为位置点.我希望能够在不触碰针的情况下显示标注.

我该怎么办?调用setSelected:YESannotationview什么也没做.我正在考虑模拟针上的触摸,但我不确定如何去做.

iphone

74
推荐指数
9
解决办法
5万
查看次数

我们如何存储到NSDictionary中?NSDictionary和NSMutableDictionary有什么区别?

我正在开发一个我想要使用的应用程序NSDictionary.任何人都可以给我一个示例代码,解释如何使用NSDictionary一个完美的例子来存储数据的过程?

iphone objective-c nsdictionary nsmutabledictionary

68
推荐指数
3
解决办法
11万
查看次数

使用Objective-C以编程方式读取文本文件

我是iPhone编程的新手

我想阅读我的Resourse文件夹中的文本文件的内容.我做了很多谷歌搜索,但没有得到正确的方法来完成这项任务.

请建议

iphone text file

60
推荐指数
2
解决办法
6万
查看次数

在iPhone应用程序中添加Facebook Like按钮

有谁知道如何在iPhone应用程序中包含一个"按钮".我尝试在内部调用iframe,UIWebView但这不起作用.

iphone facebook button facebook-like

25
推荐指数
2
解决办法
4万
查看次数

NSString的字节长度是多少?

我如何获得字节长度NSString?如果myString包含"hallo",myString.length将返回5,但是取了多少实际字节?

iphone nsstring ios

20
推荐指数
3
解决办法
1万
查看次数

UIPickerView看起来像UIDatePicker但有秒

我正在制作一个计时器应用程序,需要向用户显示小时,分钟和秒.我尝试使用,UIDatePicker但它只显示小时和分钟作为选择.不是秒.在网上做了一些研究之后,我发现没有办法获得秒数UIDatePicker,我不得不UIPickerView从头开始编写自己的.

所以我的问题是,是否有这样的示例代码,即有人写了CustomUIPickerView几个小时,分钟和秒,我可以在我的项目中加入?UIDatePicker有一个很好的覆盖时间和分钟文本,在用户旋转拨号时保持放置.如果有人在他们的自定义选择器中添加它会很好.UIPickerView如果我不需要,我不想从头开始编写自定义.谢谢.

iphone xcode ios ios5

19
推荐指数
4
解决办法
3万
查看次数

UIDocumentInteractionController的奇怪问题

我不知道这段代码有什么问题,但每当我运行应用程序时,在显示菜单后,应用程序崩溃.

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仍然可见.

我现在应该怎么做 ?

iphone document ipad

15
推荐指数
2
解决办法
2万
查看次数

适用于iPhone的Objective-C中的Sha256

当我使用此代码创建字符串的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,因为指定的编码不能用于转换接收器.

现在,我的问题是:如何插入此特殊字符以生成正确的哈希?谢谢

iphone hash xcode objective-c sha256

15
推荐指数
2
解决办法
2万
查看次数

如何在iPhone中将CVPixelBufferPool与AVAssetWriterInputPixelBufferAdaptor结合使用?

我已使用以下代码从图像成功创建了视频

-(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 objective-c avfoundation avassetwriter

15
推荐指数
2
解决办法
1万
查看次数