小编Tos*_*lji的帖子

FFmpeg vs Vitamio

我正在考虑在Android上制作视频应用.我才知道,有两条著名的图书馆,FFMPEGVitamio.

我只是想知道我可以做简单的视频功能,比如播放视频,抓取一个帧,用两个库将视频转换成mp3吗?它们的优缺点是什么?

提前致谢.

android ffmpeg vitamio

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

Xcode/Objective-C:为什么NSTimer有时会变慢/波动?

我正在开发一款iPhone游戏,我有一个NSTimer动画显示屏幕上的所有对象:

EverythingTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:self selector:@selector(moveEverything) userInfo:nil repeats:YES];
Run Code Online (Sandbox Code Playgroud)

大部分时间它运行得非常顺利,但有时我看到事情变得缓慢或波动.我有暂停和恢复功能,分别停止和启动计时器.当我暂停然后取消暂停时,似乎可以解决这个问题.

为什么会发生这种情况的任何想法?或者我该如何解决?

iphone performance objective-c nstimer

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

将unicode字符串转换为nsstring

我有一个unicode字符串

{\rtf1\ansi\ansicpg1252\cocoartf1265
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{check\}}{\leveltext\leveltemplateid1\'01\uc0\u10003 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
\paperw11900\paperh16840\margl1440\margr1440\vieww22880\viewh16200\viewkind0
\pard\li720\fi-720\pardirnatural
\ls1\ilvl0
\f0\fs24 \cf0 {\listtext    
\f1 \uc0\u10003 
\f0     }One\
{\listtext  
\f1 \uc0\u10003 
\f0     }Two\
}
Run Code Online (Sandbox Code Playgroud)

这里我有unicode数据\ u10003,相当于"✓"字符.我使用了[NSString stringWithCharacters:"\ u10003"length:NSUTF16StringEncoding],这引发了编译错误.请告诉我如何将这些unicode字符转换为"✓".

此致,热潮

unicode cocoa objective-c ios

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

HTTP音频流Android <3.0(Vitamio)

我想在Android 2.2及更高版本上通过HTTP(m3u8)播放流媒体音频.使用Android 3.0及更高版本,支持HTTP流,仅低于3.0,但不支持.

解决方案是在项目中使用Vitamio.但是,Vitamio要求用户从Play商店安装插件.

所以,我的问题: - 有没有办法将Vitamio插件嵌入到项目中? - 是否有其他解决方案用于设备<Android 3.0的HTTP流媒体?

android audio-streaming vitamio

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

接收推送通知时打开特定标签栏

如何在收到推送通知时打开特定标签栏?

我已经放在[self.tabBarController setSelectedIndex:2];viewDidAppear上,发生了什么,在数据记录中,它显示它通过tabBar 2 viewController,但它没有打开/显示该页面并保留在firstView控制器/第一个tabBar.

然后在我终止应用程序并打开后,自动/突然打开tabBar 2 viewController.

谁能提出任何想法或示例代码来解决这个问题?

这是在我的didReceiveRemoteNotification中;

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {

    NSLog(@"Remote notification received");

    if([userInfo valueForKey:@"app"]) {

        NSString *action_app = [userInfo valueForKey:@"app"];
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject:action_app forKey:@"app"];

        NewVC *sample=[[NewVC alloc]init];
        [sample viewDidLoad];

        //[self.tabBarController setSelectedIndex:2];

        [self clearNotifications];

    }else{

        NSLog(@"---nothing to read---");
    }
}
Run Code Online (Sandbox Code Playgroud)

NewVC位于tabbar 2.

cocoa-touch objective-c tabbar push-notification ios

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

在向XCode 5项目添加测试时会产生麻烦

我觉得是时候为我的iPhone应用程序编写一些测试了.不幸的是,这并不顺利.我创建了一个新的测试类但是得到了下面的错误.看起来它正在向我提供OS X库但我不知道为什么......

Ld /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator/3rdRevolutionTests.octest/3rdRevolutionTests normal i386
cd /Users/philswenson/dev/3rdRev/3R_iOS
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator -F/Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Intermediates/3rdRevolution.build/Debug-iphonesimulator/3rdRevolutionTests.build/Objects-normal/i386/3rdRevolutionTests.LinkFileList -bundle_loader /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator/3rdRevolution.app/3rdRevolution -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework SenTestingKit -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Intermediates/3rdRevolution.build/Debug-iphonesimulator/3rdRevolutionTests.build/Objects-normal/i386/3rdRevolutionTests_dependency_info.dat -o /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator/3rdRevolutionTests.octest/3rdRevolutionTests

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_XCTestCase", referenced from:
      _OBJC_CLASS_$_IsoDateTest in IsoDateTest.o
  "_OBJC_METACLASS_$_XCTestCase", referenced from:
      _OBJC_METACLASS_$_IsoDateTest in IsoDateTest.o
  "__XCTFailureFormat", referenced from:
      -[IsoDateTest testExample] in IsoDateTest.o
  "__XCTFailureHandler", referenced from:
      -[IsoDateTest testExample] in IsoDateTest.o …
Run Code Online (Sandbox Code Playgroud)

unit-testing objective-c xcode5

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

UIFont Helvetica-Regular字体问题

我需要用Helvetica-Regular创建UIFont,我使用这段代码:

UIFont *font = [UIFont fontWithName:@"Helvetica-Regular" size:size];
Run Code Online (Sandbox Code Playgroud)

但字体是nill.如何正确地做到这一点?

iphone objective-c uifont ios

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

C#通用接口将候选者列入白名单过滤

我对Generics非常陌生,并发现它在创建存储库时非常有用.我的问题必须是非常基本的水平.

假设,我已经声明了一个Generic接口

public interface IEFRepository<T> where T : class
{
    int Count { get; }
    bool Contains(T entity);
    IQueryable<T> GetAll();
    IQueryable<T> GetAll(string includeEntities);
    IQueryable<T> FindBy(Expression<Func<T, bool>> predicate, string includeEntities = "");
    T Add(T entity);
    T GetById(int id);
    void Delete(T entity);
    void Update(T entity);
    int ExecuteSQL(string commandText);
    void Delete(int id);
}
Run Code Online (Sandbox Code Playgroud)

现在,我可以通过任何实现此合同的类.但是我想限制它仅被我的Config文件中配置的白名单继承

例如.允许"人员|部门|员工".

c# generics

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

使用Oauth2成功验证后获取用户信息

在我的iPhone应用程序中,我正在使用谷歌登录使用Oauth2,我正在遵循此操作并成功登录

- (void)viewController:(GTMOAuth2ViewControllerTouch * )viewController
      finishedWithAuth:(GTMOAuth2Authentication * )auth
                 error:(NSError * )error
{


if(!error)
    {
    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Success Authorizing with Google"

                                                         message:nil
                                                        delegate:nil
                                               cancelButtonTitle:@"OK"
                                               otherButtonTitles:nil];
        [alert show];
    }
Run Code Online (Sandbox Code Playgroud)

我正在使用https://www.googleapis.com/auth/userinfo.profile范围GTMOAuth2Authentication,现在我想获取用户的基本信息,如姓名,年龄,电子邮件等.

那我怎么能得到所有细节?
我搜索很多,但没有找到任何东西.

可能重复的问题如何在iOS中获取OAuth2用户信息?,但它也没有帮助.

请帮忙

iphone ios oauth-2.0 google-oauth

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

如何分配大小为50,000,000长整数的数组

我有一个文本文件,其中有两行数字.它们中的每一个都是图形的节点.文件的大小是1.5 GB,并有92522018行.想要的东西是具有最大边数的节点.

我需要数组来解决这个问题.

有没有办法分配这个大小的数组甚至更大?

c c++

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