小编Sab*_*bby的帖子

从iPhone流式传输视频

我可以从iPhone的相机中获得单独的帧.我需要的是一种用声音打包它们以便流式传输到服务器的方法.我拥有它们后发送文件并不是什么大问题.它生成的流媒体文件我遇到了问题.我一直试图让FFMpeg没有太多运气.

任何人都有任何关于如何解决这个问题的想法?我想要一个已知的工作API或有关让FFMpeg在iPhone应用程序中正确编译的说明.

iphone video-encoding video-streaming

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

如何找到位置或在textview中找到任何单词的矩形并在其上放置按钮?

我正在开发一个故事app.Where我们需要提供quizes.现在我有一个故事,这个故事有一些空白或隐藏的话.每当我点击隐藏的单词时,我都会得到4个选项来回答这个问题.我尝试将按钮放在单词上,但这只是在我使用静态位置时.我只想知道如何获得该词的框架,我需要隐藏它,以便我可以在其上放置一些按钮并隐藏它.

你可以看到下面的图片..在此输入图像描述 所有答案将不胜感激

解决方案: - 这只能在iOS 5之后才能使用!

- (CGRect)frameOfTextRange:(NSRange)range inTextView:(UITextView *)textView
{
    UITextPosition *beginning = textView.beginningOfDocument; 
    UITextPosition *start = [textView positionFromPosition:beginning offset:range.location];
    UITextPosition *end = [textView positionFromPosition:start offset:range.length];
    UITextRange *textRange = [textView textRangeFromPosition:start toPosition:end];
    CGRect rect = [textView firstRectForRange:textRange]; 
    return [textView convertRect:rect fromView:textView.textInputView];



}
Run Code Online (Sandbox Code Playgroud)

谢谢

查看另外一张图片以查找错误: 在此输入图像描述

iphone position character objective-c uitextview

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

Uiimagepicker用于显示相机

大家好,我正在尝试制作相机应用程序.我这样做

picker.sourceType = UIImagePickerControllerSourceTypeCamera;
Run Code Online (Sandbox Code Playgroud)

其中picker是UIimagepicker Controller的对象.

但是当运行代码时,应用程序终止显示错误.

因未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'源类型1不可用'

我在模拟器上使用它.我知道在模拟器中检查相机是不可能的,但我们可以测试一下.我认为这可能是因为相机不可用,这就是它终止的原因.但我看到一个应用程序使用相同的代码但是在模拟器上运行,只显示了摄像头视图.只是帮我解决这个问题.此外,如何将我的自定义视图放入该应用程序中的相机?

iphone-sdk-3.0

10
推荐指数
1
解决办法
7458
查看次数

如何在Swift4中将NSNumber转换为String?

如何将NSNumber数组转换为String数组以便在UITableView中显示值?

cell.textlabel.text = ?
Run Code Online (Sandbox Code Playgroud)

码:

var a = [68.208983, 6.373902, 1.34085, 3.974012, 110.484001, 
         61.380001, 1.325202, 0.8501030000000001, 0.8501030000000001, 
         0.8501030000000001, 3.647296, 1.28503]
Run Code Online (Sandbox Code Playgroud)

string nsnumber swift

7
推荐指数
2
解决办法
7366
查看次数

错误,Putpkt写入失败

嗨大家我在tableview cell中显示远程图像.虽然我滚动浏览图像,删除其中一个并重新加载它们,我的应用程序退出显示此警告消息.

 Ignoring packet error, continuing...
    gdb stack trace at 'putpkt: write failed':

0   gdb-arm-apple-darwin              
Run Code Online (Sandbox Code Playgroud)

0x0019026b remote_backtrace_self + 54

recent remote packets prior to 'putpkt: write failed':
Run Code Online (Sandbox Code Playgroud)

TableView Cell图像的代码是

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *celltype=@"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:celltype];

    if (cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] autorelease];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.backgroundColor=[UIColor clearColor];
        //cell.textLabel.text=[[resultarray objectAtIndex:indexPath.row] valueForKey:@"Service"];

        /*UIImage *indicatorImage = [UIImage imageNamed:@"indicator.png"];
         cell.accessoryView =
         [[[UIImageView alloc]
         initWithImage:indicatorImage]
         autorelease];*/
        /*NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector() object:nil]; …
Run Code Online (Sandbox Code Playgroud)

iphone

6
推荐指数
1
解决办法
3134
查看次数

滚动时如何淡化到达顶部的表格视图的单元格内容?

大家好我需要实现这个功能.我需要淡化单元格的内容,而它会消失,我的意思是当它到达表格视图的顶部.我没有得到如何做到这一点.请帮助我.我试图使用scrollview的方法,但没有得到如何做到这一点.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView 
Run Code Online (Sandbox Code Playgroud)

iphone uitableview

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

iOS7:MKAnnotation centerOffset?

因此,MKAnnotation的centerOffset属性似乎不适用于iOS7以处理自定义注释图像...以下是在iOS6(工作)和iOS7(不工作)中拍摄的图像.

你们知道造成这个问题的原因是什么吗?有没有解决这个问题?

并不是因为iOS7中的centerOffset值是不相关的,所以偏移量不会随着值的变化而变化.

iOS6的 IOS 7

编辑:示例代码:

- (void)viewDidLoad
{
    [super viewDidLoad];
    MapAnnotation *ann = [[MapAnnotation alloc] initWithName:@"Some annotation" latitude:46.910068 longitude:17.881984 tag:1 type:MAP_ANNOTATION_TYPE_REQUEST];
    self.mapView.delegate = self;
    [self.mapView addAnnotation:ann];

    MKCircle *circle = [MKCircle circleWithCenterCoordinate:CLLocationCoordinate2DMake(46.910068, 17.881984) radius:10];
    [self.mapView addOverlay:circle];

}

- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay {

    if ([overlay isKindOfClass:[MKCircle class]]) {

        MKCircleView *cv = [[MKCircleView alloc] initWithCircle:overlay];
        cv.fillColor = [UIColor colorWithRed:247/255.f green:85/255.f blue:86/255.f alpha:0.2];
        cv.lineWidth = 1;
        cv.strokeColor = [UIColor colorWithRed:247/255.f green:85/255.f blue:86/255.f alpha:1.0];
        return cv;
    }

    return nil;
}

- (MKAnnotationView *)mapView:(MKMapView *)mapView …
Run Code Online (Sandbox Code Playgroud)

dictionary mkannotation ios ios7

6
推荐指数
1
解决办法
3649
查看次数

如何从NSDocumentDirectory读取数据

大家好我正在处理一个记录用户声音并将其保存到NSDocumentDirectory的应用程序.数据文件保存得很好.但问题是我想播放这些文件.我正在使用表视图来填充它NSDocumentDirectory中的文件数量.但是该表只显示当前声音文件的一个单元格.我在某处做错了请帮助我.我正在使用此代码进行播放.

-(void)PlayAudio
{


    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);

    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSLog(@"strffdsa %@",documentsDirectory);
    NSURL *fileURL = [NSURL fileURLWithPath:recorderFilePath];

    player =    [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error: nil];
    player.numberOfLoops = 0;
    //[fileURL release];

    [player play];
    [player setDelegate: self];

}
Run Code Online (Sandbox Code Playgroud)

其中,recorderFilePath是文件的路径.每次在NSDate frmattor的帮助下,路径都是新的.但是没有得到如何使用驻留在DocumentDirectory中的所有文件填充表视图.

请帮助我......我是这项技术的新手.

在此先感谢所有........

iphone nsdocument

5
推荐指数
1
解决办法
4190
查看次数

Symfony2强制twig输出XML格式化数据

我正在使用Symfony2并努力使用twig以XML格式输出数据.相反,twig只会将大量文本块抛到浏览器上,只有当右键单击查看源代码时,我才能看到布局合理的XML.

有没有什么方法可以强制Twig实际输出格式化的XML而不是查看页面源...?

sitemap.xml.twig:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        {% for entry in sitemapresp %}
            <loc>{{ entry['url'] }}</loc>
            <lastmod>{{ entry['date'] }}</lastmod>
            <changefreq>{{ entry['frequency'] }}</changefreq>
            <priority>{{ entry['priority'] }}</priority>

        {% endfor %}
    </url>
</urlset>
Run Code Online (Sandbox Code Playgroud)

浏览器输出:

http://www.sitemappro.com/2015-01-27T23:55:42+01:00daily0.5http://www.sitemappro.com/download.html2015-01-26T17:24:27+01:00daily0.5
Run Code Online (Sandbox Code Playgroud)

源视图输出:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.google.com/schemas/sitemap/0.90">
      <url>
        <loc>http://www.sitemappro.com/</loc>
        <lastmod>2015-01-27T23:55:42+01:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5</priority>
      </url>
      <url>
        <loc>http://www.sitemappro.com/download.html</loc>
        <lastmod>2015-01-26T17:24:27+01:00</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5</priority>
      </url>
</urlset>
Run Code Online (Sandbox Code Playgroud)

有什么建议..?

php xml sitemap symfony

5
推荐指数
2
解决办法
7561
查看次数

如何获取域名?

嗨,大家好,我有一个数组,我得到的链接到网站,如

http://clickfrom.buy.com/default.asp?adid\u003d17379&sURL\u003dhttp%3A%2F%2Fwww.buy.com%2Fprod%2Fkimberly-clark-professional-kleenex-boutique-white-facial-tissue-2-ply%2Fq%2Floc%2F66357%2F211347223.html
Run Code Online (Sandbox Code Playgroud)

我想要的只是获得主域名.clickfrom.buy.com

主要网站地址.如何实现......

iphone

4
推荐指数
1
解决办法
4732
查看次数