我已经通过使用GitHub API3将github成功集成到了我的ios App中。
但我的问题是我无法删除/撤消访问令牌。
我尝试了以下代码
NSString * querystr= @"https://api.github.com/authorizations";
// i tried this url url also https://api.github.com/authorizations?client_id=1234yyrhrh
NSMutableURLRequest *request2 = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:querystr]];
[NSURLConnection sendAsynchronousRequest:request2 queue:theQ
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
{
NSArray * array = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"%@",array);
}];
Run Code Online (Sandbox Code Playgroud)
我没有收到任何错误,但是数组正在打印以下消息
"documentation_url" = "http://developer.github.com/v3";
message = "Not Found";
Run Code Online (Sandbox Code Playgroud)
提前致谢
我已经创建了一个类别的导航控制器和设置标题和左右按钮在视图中加载此导航控制器类(此类的类别).
- (void)viewDidAppear:(BOOL)animated
{
NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
if ([[ver objectAtIndex:0] intValue] >= 7) {
self.navigationBar.barTintColor = [UIColor colorWithRed:229.0f/255.0f green:114.0f/255.0f blue:89.0f/255.0f alpha:1.0f];
self.navigationBar.translucent = NO;
}else{
self.navigationBar.tintColor = [UIColor colorWithRed:229.0f/255.0f green:114.0f/255.0f blue:89.0f/255.0f alpha:1.0f];
}
UILabel *lblTitleView=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 170, 44)];
[lblTitleView setTextColor:[UIColor whiteColor]];
[lblTitleView setFont:[UIFont boldSystemFontOfSize:17]];
[lblTitleView setText:[self SetnavigationTitle:self.navigationItem.title]];
[lblTitleView setTextAlignment:NSTextAlignmentCenter];
[lblTitleView setBackgroundColor:[UIColor clearColor]];
[self.navigationItem setTitleView:lblTitleView];
// UINavigationController*navCnt = [[UINavigationController alloc] init];
UIButton *btnLeft=[UIButton buttonWithType:UIButtonTypeCustom];
[btnLeft setFrame:CGRectMake(0, 5, 32, 32)];
[btnLeft setImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateNormal];
[btnLeft setImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateHighlighted]; …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的 NSFetchRequest 设置为核心数据以检索列的所有值的总和。我的学生记录采用以下格式
name | id | marks |
_______|_____|_________|
Jack | 12 | 34 |
John | 13 | 27 |
Jeff | 1 | 42 |
Don | 34 | 32 |
Edward | 43 | 35 |
Ricky | 23 | 24 |
Run Code Online (Sandbox Code Playgroud)
任何人都可以建议我设置一个 NSFetchRequest 来返回记录中所有标记的总和
我在表格中集成了添加行和删除行功能.如果我添加行第二行编号也是1.我需要number of each row按照每次添加和删除更改,如1,2等.
我使用了这个小提琴http://jsfiddle.net/MJGV2/6/的代码.
怎么做到这一点?任何帮助,将不胜感激.谢谢.
我的UITextField故事板中有两个s用于输入用户输入的数字,minPrice和maxPrice.当我在模拟器中单击提交时,应用程序崩溃,我收到以下错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(
0 CoreFoundation 0x02a881e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x026468e5 objc_exception_throw + 44
2 CoreFoundation 0x02a4e376 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 390
3 CoreFoundation 0x02a7bc29 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 73
4 Parse+Storyboard 0x0000b5b5 -[CriteriaViewController submitButton:] + 757
5 libobjc.A.dylib 0x02658880 -[NSObject performSelector:withObject:withObject:] + 77
6 UIKit 0x013083b9 -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x01308345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + …Run Code Online (Sandbox Code Playgroud) 我使用MPMoviePlayerController播放视频,但这只显示黑屏.没有播放我的视频.这段代码是对的.哪里可能我错了....
我已经完成了这段代码来播放视频..
NSString * str=[[NSBundle mainBundle]pathForResource:@"iGreet" ofType:@"m4v"];
NSURL * url=[NSURL fileURLWithPath:str];
MPMoviePlayerController * movieController=[[MPMoviePlayerController alloc]initWithContentURL:url];
movieController.controlStyle=MPMovieControlStyleFullscreen;
[movieController.view setFrame:self.view.bounds];
[self.view addSubview:movieController.view];
[movieController prepareToPlay];
[movieController play];
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏..在此先感谢..
我试图将来自服务器的userid存储到userDefaults这是一个NSUserDefault对象,但它总是显示0为userDefaults的值,我曾尝试过使用setObject方法,但仍然无法正常工作,我检查了来自服务器的信息它从不为0.用户id的值永远不会为0,但NSUserDefault仍显示为0.
int userid=[[userdata objectForKey:@"id"] integerValue];
[userDefaults setInteger:userid forKey:@"UserID "];
[userDefaults synchronize];
NSLog(@"UID: %d",[[NSUserDefaults standardUserDefaults] integerForKey:@"UserID"]);
Run Code Online (Sandbox Code Playgroud)
请帮我谢谢.
我想实现一个基于iPhone的应用程序ios7 ,我需要一些帮助来创建水平UItableView.
当我尝试登录时,它会显示以下错误:
错误:错误Domain = com.facebook.sdk Code = 2"操作无法完成.(com.facebook.sdk error 2.)"UserInfo = 0xa54db80 {com.facebook.sdk:ErrorLoginFailedReason = com.facebook.sdk :SystemLoginCancelled,com.facebook.sdk:ErrorInnerErrorKey = Error Domain = com.apple.accounts Code = 7"无法完成操作.(com.apple.accounts error 7.)",com.facebook.sdk:ErrorSessionKey =,expirationDate:(null),refreshDate:(null),attemptsRefreshDate:0001-12-30 00:00:00 +0000,permissions:(null)>}
当我从facebook(官方)登录时,这工作正常.提前致谢.
ios ×7
objective-c ×4
iphone ×3
ios7 ×2
access-token ×1
core-data ×1
facebook ×1
github-api ×1
javascript ×1
jquery ×1
login ×1
oauth ×1
sum ×1
uitableview ×1
uitextfield ×1
video ×1
xcode5 ×1