我最近将我的一个测试iphone升级到iOS 8,然后升级了PUSH注册码,如下所示(使用xCode 6)
-(BOOL)hasNotificationsEnabled {
NSString *iOSversion = [[UIDevice currentDevice] systemVersion];
NSString *prefix = [[iOSversion componentsSeparatedByString:@"."] firstObject];
float versionVal = [prefix floatValue];
if (versionVal >= 8)
{
NSLog(@"%@", [[UIApplication sharedApplication] currentUserNotificationSettings]);
//The output of this log shows that the app is registered for PUSH so should receive them
if ([[UIApplication sharedApplication] currentUserNotificationSettings].types != UIUserNotificationTypeNone) {
return YES;
}
}
else
{
UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (types != UIRemoteNotificationTypeNone){
return YES;
}
}
return NO;
}
-(void)registerForPUSHNotifications { …Run Code Online (Sandbox Code Playgroud) 我有一个简单的UICollectionView,我在InterfaceBuilder中设置了0间距但是当我用单元格填充集合视图时,仍然有一些间距.是否有一些特殊而且不是很明显我需要做的是为了实际看到一个带有0间距的集合视图单元格而不是设置为0间距?谢谢.
编辑*一些代码:
- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
cell.backgroundColor = [UIColor clearColor];
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(2, 2, cell.frame.size.width -4, cell.frame.size.height -4)];
lbl.backgroundColor = [UIColor clearColor];
lbl.font = [UIFont boldSystemFontOfSize:20];
lbl.text = [NSString stringWithFormat:@"$%0.0f", [[amountsArray objectAtIndex:indexPath.row] floatValue]];
lbl.textAlignment = NSTextAlignmentCenter;
lbl.layer.borderWidth = 1;
[cell addSubview:lbl];
[lbl release];
return cell;
}
Run Code Online (Sandbox Code Playgroud)

在亚马逊alexa技能请求中有一个userId,我试图了解这是什么,如果有一些参考,因为我想链接和Amazon Echo用户帐户与我自己的应用程序中的帐户,并这样做我必须有某种静态userId才能使用.
示例请求:
{
"version": "1.0",
"session": {
"new": false,
"application": {
"applicationId": "amzn1.echo-sdk-ams.app.[unique-value-here]"
},
"sessionId": "session1234",
"attributes": {},
"user": {
"userId": null //IS THERE A DETAILED REFERENCE OF THIS SOMEWHERE?
}
},
"request": {
"type": "IntentRequest",
"requestId": "request5678",
"intent": {
"name": "MyColorIsIntent",
"slots": {
"Color": {
"name": "Color",
"value": "blue"
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) amazon userid amazon-web-services alexa-skill alexa-skills-kit
我似乎无法创建具有透明背景的NSScrollView.有谁知道为什么?这是我的代码:
NSScrollView *textScroll = [[NSScrollView alloc] initWithFrame:CGRectMake(212, 203, 381, 55)];
[textScroll setBackgroundColor:[NSColor clearColor]];
[view addSubview:textScroll];
Run Code Online (Sandbox Code Playgroud) 您好我已尝试以下但无法从我的应用程序中删除状态栏:
所有这些都曾经在我之前做过的100个应用程序中运行良好,但我最近进行了xcode升级.
有没有其他秘密方式摆脱应用程序中的状态栏?我是否需要前往Apple总部并杀死一条红龙?
在AWS API Gateway中,我有一个调用lambda函数的GET方法.
当我在API网关仪表板中测试该方法时,lambda函数成功执行,但API Gateway未将context.success()调用映射到200结果,尽管默认映射设置为yes.
相反,我得到这个错误:
Execution failed due to configuration error: No match for output mapping and no default output mapping configured
Run Code Online (Sandbox Code Playgroud)
基本上我希望API网关识别成功的lambda执行,然后默认将它映射到200响应,但这不会发生.
有谁知道为什么这不起作用?
我正在创建并解雇NSTimer:
ncTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(handleTimer:)
userInfo:nil
repeats:YES];
[ncTimer fire];
Run Code Online (Sandbox Code Playgroud)
和
- (void)handleTimer:(NSTimer *)chkTimer {
// do stuff
}
Run Code Online (Sandbox Code Playgroud)
我保留我的计时器:
@property (nonatomic, retain) NSTimer *ncTimer;
Run Code Online (Sandbox Code Playgroud)
由于某种原因,计时器不重复.它只发射一次而不是再发射一次.
在我的应用程序中,我更改standardWindowButtons close/miniturize/expand的位置,如下所示:
//Create the buttons
NSButton *minitButton = [NSWindow standardWindowButton:NSWindowMiniaturizeButton forStyleMask:window.styleMask];
NSButton *closeButton = [NSWindow standardWindowButton:NSWindowCloseButton forStyleMask:window.styleMask];
NSButton *fullScreenButton = [NSWindow standardWindowButton:NSWindowZoomButton forStyleMask:window.styleMask];
//set their location
[closeButton setFrame:CGRectMake(7+70, window.frame.size.height - 22 - 52, closeButton.frame.size.width, closeButton.frame.size.height)];
[fullScreenButton setFrame:CGRectMake(47+70, window.frame.size.height - 22 -52, fullScreenButton.frame.size.width, fullScreenButton.frame.size.height)];
[minitButton setFrame:CGRectMake(27+70, window.frame.size.height - 22 - 52, minitButton.frame.size.width, minitButton.frame.size.height)];
//add them to the window
[window.contentView addSubview:closeButton];
[window.contentView addSubview:fullScreenButton];
[window.contentView addSubview:minitButton];
Run Code Online (Sandbox Code Playgroud)
现在当窗口出现时带有按钮有两个问题:1.它们是灰色而不是正确的颜色2.当鼠标悬停在它们上面时,它们不显示+ - 或x符号
任何人都可以告诉我我做错了什么.谢谢.
当我在iTunes Connect>用户和角色> iTunes中添加用户时连接用户> +(添加用户)
Itunes connect说"已经发送了一个verificartion电子邮件给..."(见截图),但从未收到过电子邮件(即使在垃圾邮件文件夹中).我无法将用户添加到我的itunes连接中,因为他们无法激活他们的帐户.
我尝试的任何电子邮件都会出现此问题(包括新创建的没有iTunes帐户)
有没有人知道解决这个问题的方法或为什么会发生这种情况?

如果我执行Facebook图形api搜索,例如:
https://graph.facebook.com/search?q=query&type=user
Run Code Online (Sandbox Code Playgroud)
查询只是一个单词,如'马克',一切都很好,有结果.但是,如果查询是两个单词,例如'Mark Roberts',则不会返回任何结果.
我曾尝试使用'Mark + Roberts',并尝试使用带有转义的URL编码,但这没有用.但是,当我使用两个关键字并删除&type = user时,我会得到结果(尽管有大量随机的facebook内容).
所以:
https://graph.facebook.com/search?q=mark&type=user < WORKS
https://graph.facebook.com/search?q=mark+robers&type=user < DOES NOT WORK
https://graph.facebook.com/search?q=mark+robers < WORKS (but does not return people)
Run Code Online (Sandbox Code Playgroud)
有没有人遇到过这个问题?
Facebook似乎没有提及任何相关内容:http://developers.facebook.com/docs/reference/api/search/
注意:我当然正在使用经过身份验证的APP ID并登录用户等.
iphone ×4
ios ×3
cocoa ×2
macos ×2
objective-c ×2
alexa-skill ×1
amazon ×1
aws-lambda ×1
aws-sdk ×1
facebook ×1
layout ×1
nsbutton ×1
nsscrollview ×1
nstimer ×1
nswindow ×1
push ×1
sdk ×1
spacing ×1
status ×1
testflight ×1
userid ×1
xcode ×1