如何将月添加到NSDate对象?
NSDate *someDate = [NSDate Date] + 30Days.....;
Run Code Online (Sandbox Code Playgroud) 我想在y应用程序中使用自定义字体.
我在info.Plist文件中声明了"应用程序提供的字体"
并将label.font设置为带/不带.TTF扩展名的字体
将TTF文件拖入项目并将文件复制到项目中
为标签创造了一个出口,但仍然没有任何作用.
如果有人知道那边发生了什么,我想得到一些帮助.
最近我注意到这个问题已知为@ 4.1(xcode版本).
TNX :)
我在试图UIImageview
连续旋转球内部的图像时出现问题.我希望这个球在其中心轴上连续旋转.我尝试过使用CGAffineTransform
但它没有用.
请帮忙!
我发送一个对象给这个adrees: https://sandbox.itunes.apple.com/verifyReceipt
有NSUrlconnection
,我试图用这个委托方法来阅读:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
像这样 :
NSlog(@"%@",response);
我得到这个代码:
<NSHTTPURLResponse: 0x7d2c6c0>
我需要以某种方式得到一个字符串.我该怎么读?
我正在GET
请求检索JSON
数据,AFNetworking
如下面的代码:
NSURL *url = [NSURL URLWithString:K_THINKERBELL_SERVER_URL];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
Account *ac = [[Account alloc]init];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"GET" path:[NSString stringWithFormat:@"/user/%@/event/%@",ac.uid,eventID] parameters:nil];
AFHTTPRequestOperation *operation = [httpClient HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSError *error = nil;
NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:&error];
if (error) {
}
[self.delegate NextMeetingFound:[[Meeting alloc]init] meetingData:JSON];
}
failure:^(AFHTTPRequestOperation *operation, NSError *error){
}];
[httpClient enqueueHTTPRequestOperation:operation];
Run Code Online (Sandbox Code Playgroud)
问题是我想基于这些数据创建单元测试,但我不希望测试实际上会发出请求.我希望预定义的结构将作为响应返回.我是一个新的单元测试,并戳了一点,OCMock
但无法弄清楚如何管理这个.
我UITableViewCell
在我的子课程中UITableView
.我之前做了大约一千次,但现在我想抓住这个委托活动:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath;
Run Code Online (Sandbox Code Playgroud)
触摸单元格时,应调用此回调.但我只是在触摸后按下6秒或6次,但不是每次触摸都会调用.
tableview是一个子类的子视图,UIView
我在下面调用它awakeFromNib
:
-(void)awakeFromNib{
_table_view.delegate = self;
_table_view.dataSource = self;
}
Run Code Online (Sandbox Code Playgroud)
tableview自己很好,但这个事件运作不佳.有任何想法吗?
这是UITableViewCell
子类代码.m
#import "FLBlockedPersonCell.h"
@implementation FLBlockedPersonCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
[super setHighlighted:highlighted animated:animated];
}
@end
Run Code Online (Sandbox Code Playgroud) 我刚刚更新到Xcode
5并且我的项目正在使用GIT
,更新完成后,每个文件附近的项目导航器文件中突然出现问号.
当我试图Commit
我没有看到什么文件被更改,我也不能拉,当我试图推动它给:推动成功"消息,但存储库上GitHub
没有更新.
我正在使用Unity3D 4.3
并调用DLL
我创建的那个.当试图调用它所拥有的唯一函数时,这是:
void GetModelReferences(int &nVertices, float * vertices, int &nTriangles, int * triangles, float * normals, float * uvCoordinates);
Run Code Online (Sandbox Code Playgroud)
团结给了我一个错误:
Unsafe code requires the `unsafe' command line option to be specified
Run Code Online (Sandbox Code Playgroud)
所以在我MonoDevelop
打开的时候:Project->Assembly-Csharp options
打开unsafe
模式.
它减少了部分错误,但最后一个不会消失
Unsafe code requires the `unsafe' command line option to be specified
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
我Objective-C
在我的iOS
项目中有类,它在同一个类中实现Objective-C
和C
编码.我将扩展名改为.mm
,这部分进展顺利.现在我想设置一个C
方法来调用Objective-C
同一个类中的方法.我得到的问题是当我尝试self
从该C
方法调用时.这是代码:
void SetNotificationListeners(){
[self fireSpeechRecognition];
}
Run Code Online (Sandbox Code Playgroud)
错误是:
Use of undeclared identifier 'self'
Run Code Online (Sandbox Code Playgroud)
我该怎么办呢?
我正在向我的用户发送推送有效负载,其中包含以下内容:
{"aps": {"alert": "Go To Google", "sound": "Default","url":"http://www.google.com"}}
Run Code Online (Sandbox Code Playgroud)
当pp运行但在后台时,一切顺利.如果我收到推送并且应用程序已关闭,我打开它并且没有任何反应.我正在尝试重定向到有效负载中的此URL.当应用程序从后台运行时它再次运行良好.
这是到目前为止AppDelegate.m的实现:
-(void)Redirect:(NSString*)url{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
NSLog(@"%@",url);
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
RedirectedUri = [[userInfo objectForKey:@"aps"] objectForKey:@"url"];
NSLog(@"%@",RedirectedUri);
[self Redirect:RedirectedUri];
}
Run Code Online (Sandbox Code Playgroud)
需要一些帮助.
ios ×8
objective-c ×6
iphone ×5
cocoa-touch ×2
afnetworking ×1
animation ×1
c ×1
c# ×1
dll ×1
git ×1
nsdate ×1
ocmock ×1
uifont ×1
uilabel ×1
uitableview ×1
unit-testing ×1
unsafe ×1
xcode ×1
xcode4 ×1
xcode5 ×1