我正在尝试将很长的UTC时间戳转换为东部标准时间,并且完全迷路了。任何提示都很棒!
谢谢,R
由于我对obj c和NSMutable数组的完全误解,我最近问过一些骨头问题,我可以理解地吸引了一些自作聪明.所以我看了一本书和谷歌,看起来可能是我不应该编程因为我还是卡住了.
假设我正在循环方法A并且每个循环通过我想在NSMutable数组中添加一个double.这是我到目前为止所发现的.
你不能把基元放在数组中,所以我把我的double变成了NSNumber对象
NSNumber *newObject = [NSNumber initWithDouble:doubleNumber];
Run Code Online (Sandbox Code Playgroud)
XCode警告:'NSNumber'可能无法响应'+ initWithDouble:'
当我编译它时得到:
由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'+ [NSNumber initWithDouble:]:无法识别的选择器发送到类0x1ffea0'
我忽略了这一点并伪造.有人告诉我,我需要一个数组的init方法,这是有道理的,因为我不希望在循环中发生这种情况.这是我的init方法:
-(id) init{
[super init];
arrayOfTouches = [[NSMutableArray alloc] init];
return self;
}
Run Code Online (Sandbox Code Playgroud)
我还没有尝试将它添加到阵列中.
[arrayOfTouches addObject:newObject];
Run Code Online (Sandbox Code Playgroud)
这是否可以打印出阵列.
NSLog(@"array: %@", touchBeginObj);
Run Code Online (Sandbox Code Playgroud)
骨头问题,可能.但该死的,如果我能找到任何关于你能做什么和不能做一个好榜样的所有部分.
感谢您的任何帮助或自作聪明评论.
是的,我有一本Obj-C书,实际上是3本,是的,我正在阅读它们:)
周末愉快.
basicLog是名称和时间戳列表.我想把它们写到一个文件中.我得到的两个错误是';' 在StreamWriter行和'file'上.在第二行.
';' 错误是:可能出错的空语句文件中的错误是:当前上下文中不存在名称"file".
文件创建得很好,但没有任何内容写入它.我对当前上下文中不存在的文件感到困惑,因为在创建之前的行上.感谢您的任何帮助.
foreach (BasicLog basicLog in emailAttach)
{
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\\sorted.txt", true));
file.WriteLine(basicLog.LastName + " - " + basicLog.InOrOut + " - " + basicLog.EventTime + "\n");
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试一个核心情节iphone示例,我得到:
没有要编译的体系结构(ONLY_ACTIVE_ARCH = YES,活动arch = i386,VALID_ARCHS = armv6 armv7).
在项目设置 - >体系结构下,唯一的选项是标准,优化和本机arch.
有任何想法吗?
谢谢.
遵循建议的链接重置root的说明以及stackoverflow中的其他建议.无论是否使用--defaults-file选项,我都试图通过两种方式重置我的root pass
首先我试过了.
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" –init-file=C:\\mysql-init.txt --console
Run Code Online (Sandbox Code Playgroud)
错误:
C:\ Program Files\MySQL\MySQL Server 5.5\bin\mysqld:参数太多(第一个额外的是'ûinit-file = C:\ mysql-init.txt').
接下来我试过了
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 5.5\\my.ini" MySQL55 –init-file=C:\\mysql-init.txt --console
Run Code Online (Sandbox Code Playgroud)
错误:
C:\ Program Files\MySQL\MySQL Server 5.5\bin\mysqld:参数太多(第一个ex tra是'MySQL55').
"太多的争论"让我觉得我的语法就是问题
基于chrome开发人员工具的一个断点,我认为我正在处理我可以解决的范围问题.这是我定义函数的方式吗?下面的脚本是一个包含js文件和数组'timeStamp我想在其他函数中使用,而不必每次都调用我的loadData函数.
timeStamp数组在离开for循环之前一旦离开函数就变为未定义.
var timeStamp = []; // Want this array to be global
function loadData (url){
$.getJSON(url, function(json) {
for (var i=0;i<json.length;i++){
timeStamp.push(json[i].TimeStamp);
}
console.log(inputBITS); //returns the value
});
console.log(inputBITS); //undefined
}
Run Code Online (Sandbox Code Playgroud)
感谢您的任何帮助
带有journalComment.delegate = self的行警告:从不兼容类型'JournalEntryViewController*'分配给'id'
journalComment是一个textView.
我不确定警告是什么,它应该只是说 - 警告:"键盘上的新手,去参加一些obj c课程."
感谢您的任何帮助.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
// Hide keyboard when done key is pressed
// define the area and location for the UITextView
CGRect tfFrame = CGRectMake(0, 0, 320, 460);
journalComment = [[UITextView alloc] initWithFrame:tfFrame];
// make sure that it is editable
journalComment.editable = YES;
// add the controller as the delegate
journalComment.delegate = self;
}
return self;
}
Run Code Online (Sandbox Code Playgroud) 我在至少三个教程中看到了这段小代码,当我按下连接到我得到的动作的按钮时:
'NSInvalidArgumentException',原因:' * - [NSURL initFileURLWithPath:]:nil string parameter'
它说我的路径为空,这是根据控制台.对我缺少什么有任何想法?
-(IBAction) pushStart
{
NSString *arrowSoundPath = [[NSBundle mainBundle] pathForResource:@"Arrow.mp3" ofType:@"mp3"];
NSLog(@"%@",arrowSoundPath);
AVAudioPlayer *theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:arrowSoundPath] error:NULL];
theAudio.delegate = self;
[theAudio play];
}
Run Code Online (Sandbox Code Playgroud) 只是希望屏幕根据奇数或偶数条件反复闪烁蓝色/红色一段时间,但它只运行一次,而不是30,000次.我错过了什么?
-(IBAction) changeBackgroundColor:(id)sender
{
for (int y = 0; y < 30000; y++)
{
if(y % 2)
{
self.view.backgroundColor = [UIColor blueColor];
colorView.backgroundColor = [UIColor redColor];
} else {
self.view.backgroundColor = [UIColor redColor];
colorView.backgroundColor = [UIColor blueColor];
}
}
}
Run Code Online (Sandbox Code Playgroud) 我从这里抓住了这个紧凑的新闻阅读器下面是点击链接时动画放松和简化预览的代码.我将整个页面的尺寸从300的高度更改为600.我做了一些谷歌搜索,jquery的动画部分动画了元素的CSS属性.所以我从那里开始工作.以为我有事情可行,但事实并非如此,我想我会再次从头开始.
任何人都可以解读这个吗?例如,我只是猜测,"动画页面元素的顶级css到-300px ...我不明白的其余部分.
感谢您提供任何帮助,骚扰或指示.
$current.stop().animate({'top':'-300px'},600,'easeOutBack',function(){
$(this).css({'top':'310px'});
Run Code Online (Sandbox Code Playgroud)
sdfadssf
$items.each(function(i){
var $item = $(this);
$item.data('idx',i+1);
$item.bind('click',function(){
var $this = $(this);
$cn_list.find('.selected').removeClass('selected');
$this.addClass('selected');
var idx = $(this).data('idx');
var $current = $cn_preview.find('.cn_content:nth-child('+current+')');
var $next = $cn_preview.find('.cn_content:nth-child('+idx+')');
if(idx > current){
$current.stop().animate({'top':'-300px'},600,'easeOutBack',function(){
$(this).css({'top':'310px'});
});
$next.css({'top':'310px'}).stop().animate({'top':'5px'},600,'easeOutBack');
}
else if(idx < current){
$current.stop().animate({'top':'310px'},600,'easeOutBack',function(){
$(this).css({'top':'310px'});
});
$next.css({'top':'-300px'}).stop().animate({'top':'5px'},600,'easeOutBack');
}
current = idx;
});
});
Run Code Online (Sandbox Code Playgroud) objective-c ×4
iphone ×3
javascript ×2
audio ×1
c# ×1
compilation ×1
core-plot ×1
datetime ×1
easing ×1
java ×1
jquery ×1
loops ×1
mp3 ×1
mysql ×1
reset ×1
scope ×1
streamwriter ×1
uitextview ×1
utc ×1