本周推出了iOS 7 Beta,每当更新发布时,这些都必须更新应用程序以兼容性设置一些错误.
好吧,我在我的iPhone上安装了iOS 7并且应用程序原理完美运行,然后安装了Xcode 5(预览版)并编译了我的项目,我意识到新的statusBar现在完全平静,你的视图控制器将显示为她的背景.
这就是出现问题的地方,屏幕底部有一个20px的白色条带,由于视图控制器赢得了曾经是statusBar的空间.
如果我在我的故事板中修复此问题就可以了,但是由于20px statusBar,iOS 6中的问题仍然存在,屏幕将被切断.
我认为简单的解决方案是在启动时检查iOS的版本并根据每个创建一个故事板.在我的项目中,我有3个故事板,iPhone 3.5','iPhone 4'和'iPad'.很快就要创建3个故事板,因为这20个px.
那将是最好的解决方案吗?我还有其他选择吗?
抱歉,长篇文章.欢迎任何帮助!
我尝试使用Stig的JSON库发出HTTP请求并解析JSON.我收到此错误'autorelease'不可用:当我使用此代码时,在自动引用计数模式下不可用
NSURLRequest *request2;
request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://sandbox.CompanyName.com/api/%@/users/%@/user_badges?url=CompanyName.map2.com&amount=999999999999",[information stringForKey:@"apiKey"] , [information stringForKey:@"userID"]]]];
NSURLConnection *connection2;
connection2 = [[NSURLConnection alloc] initWithRequest:request2 delegate:self startImmediately:YES];
NSURLResponse *resp2;
NSData *cData2 = [NSURLConnection sendSynchronousRequest:request2 returningResponse:&resp2 error:nil];
NSString *cDataString2 = [[NSString alloc] initWithData:cData2 encoding:NSUTF8StringEncoding];
NSLog(@"getUsersBadges called");
NSError *error4;
SBJSON *json4 = [[SBJSON new] autorelease];
// NSArray *luckyNumbers = [json objectWithString:responseString error:&error];
NSDictionary *luckyNumbers4 = [json4 objectWithString:cDataString2 error:&error4];
[cDataString2 release];
Run Code Online (Sandbox Code Playgroud)
UPDATE
对于任何感兴趣的人,这是正确的代码:NSURLRequest*request2; request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@" http://sandbox.CompanyName.com/api/%@/users/%@/user_badges?url=CompanyName.map2.com&ount =999999999999 ",[ information stringForKey:@"apiKey"],[information stringForKey:@"userID"]]]];
NSURLConnection *connection2;
connection2 …Run Code Online (Sandbox Code Playgroud) 我试图将字符串设置为"如果[object objectForKey @"display_name"]为NULL,则为"无显示名称".它在日志中崩溃了
2011-06-16 10:58:36.251 BV API[15586:ef03] displayNameType is: NSNull
2011-06-16 10:58:36.251 BV API[15586:ef03] +[NSNull isEqualToString:]: unrecognized selector sent to class 0x1228c40
2011-06-16 10:58:36.253 BV API[15586:ef03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSNull isEqualToString:]: unrecognized selector sent to class 0x1228c40'
*** First throw call stack:
(0x1198f1c 0x132b52e 0x119bb2b 0x10f3076 0x10f2bb2 0x116d9 0x112ad 0x8b0e17 0x8b9783 0x8b43ae 0x8b9d20 0xb6312b 0x815c35 0xac2e1e 0x8b7583 0x8b771d 0x8b775d 0xc1b5 0x7ed84c 0x7ed7e2 0x89477a 0x894c4a 0x893ee4 0x813002 0x81320a 0x7f960c 0x7ecd52 0x211b8f6 0x116831a 0x10c3d07 0x10c1e93 0x10c1750 …Run Code Online (Sandbox Code Playgroud) 我试图将UISlider的值设置为AVPlayer的当前时间.
我正在尝试使用此代码 audioPlayer.currentTime = nowPlayingSlider.value;
我收到此错误:
Setter method is needed to assign to object using property assignment syntax
我如何让它工作.
我想使用AVAudioPlayer依次播放多个MP3文件(一个接一个).我试了一下,播放完第一张MP3后就停止了.但是,如果我进入调试器,它工作正常..任何想法?我在某处读到AVAudioPlayer在后台播放音频..我该如何阻止它这样做?沃什
我正在制作一个 iPhone 应用程序,并想为 AVPlayer 制作一个搜索栏。我想用 UISlider 来实现。我怎样才能做到这一点?
我在我的应用程序中使用FB Open Graph.它没有完全发挥作用.当我发布一个对象时,它出现在用户最近的活动中; 但是,它没有出现在他们的时间表上.元数据没有错误,我正在使用FBGraph gem但是当我使用curl时它也不起作用.有任何建议来解决这个问题吗?
我在回形针方面遇到了一些问题.当我有一个跟随大小的"#"(缩放和裁剪)时,我得到422错误.我的日志说明了这个:
Command :: convert '/tmp/**** (20130110)20130311-13571-xxasmt.png[0]' -auto-orient -resize "150x150#" '/tmp/**** (20130110)20130311-13571-xxasmt20130311-13571-1anrx0y'
[paperclip] An error was received while processing: #<Paperclip::Error: There was an error processing the thumbnail for **** (20130110)20130311-13571-xxasmt>
Completed 422 Unprocessable Entity in 2785ms (Views: 0.8ms | ActiveRecord: 9.1ms)
Run Code Online (Sandbox Code Playgroud)
这是我在模型中的回形针代码:
has_attached_file :image,
:styles => {
:medium => "300x300#",
:thumb => "100x100>",
:standard => "150x150>"
},
:storage => :s3,
:s3_credentials => "#{Rails.root}/config/s3.yml",
:bucket => "convertkit",
:s3_protocol => "https"
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
当我尝试通过运行:安装iconv时rvm pkg install iconv,它失败并显示以下错误:
Error running 'autoreconf -is --force',
please read /usr/local/rvm/log/libiconv/autoreconf.log
Configuring libiconv in /usr/local/rvm/src/libiconv-1.13.1.........................
Error running './configure --prefix=/usr/local/rvm/usr --enable-shared',
please read /usr/local/rvm/log/libiconv/configure.log
Compiling libiconv in /usr/local/rvm/src/libiconv-1.13.1..
Error running 'make -j1',
please read /usr/local/rvm/log/libiconv/make.log
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Run Code Online (Sandbox Code Playgroud)
在日志中,它说:
root@web01:~# cat /usr/local/rvm/log/libiconv/autoreconf.log
configure.ac:134: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:606: AS_IF …Run Code Online (Sandbox Code Playgroud) 当我使用这段代码时:
NSLog(@"- (void)connectionDidFinishLoading:(NSURLConnection *)%@", connection);
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSDictionary *missionsDict = [responseString JSONValue];
/*NSArray *luckyNumbers = [json objectWithString:responseString error:&error];*/
NSLog(@"user Info array is: %@", missionsDict);
// NSDictionary *array = [luckyNumbers1 objectForKey:@"data"];
NSDictionary *missionsData;
missionsData = [missionsDict objectForKey:@"data"];
NSLog(@"missionsData is: %@", missionsData);
NSEnumerator *inner = [missionsData objectEnumerator];
UIScrollView *missionsScroll;
missionsScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
missionsScroll.contentSize = CGSizeMake(320, 1005);
[self.view addSubview:missionsScroll];
id value;
int badgeY1;
int badgeY2;
int badgeY3;
badgeY1 = …Run Code Online (Sandbox Code Playgroud)