从我的iOS应用程序分享照片到Instagram

我一直在寻找一种方式来从我正在开发的iOS应用程序发布照片到Instagram。 但看到一些链接,似乎是他们不支持使用他们的API写访问。 所以, 是否有可能通过一些API或Instagram API从iOS分享照片到Instagram? 如果可能的话,任何人都可以给我build议一个教程或文档来做到这一点? 他们的api说这个… “目前,通过API上传是不可能的,我们有意识地select不添加这个,原因如下: Instagram是关于你在旅途中的生活 – 我们希望鼓励在应用程序内的照片。 但是,将来我们可能会根据具体情况给予单个应用的白名单访问权限。 我们想打击垃圾邮件和低质量的照片。 一旦我们允许从其他来源上传,就很难控制进入Instagram生态系统的内容。 所有这一切,我们正在努力确保用户在我们的平台上获得一致的,高质量的体验。“ 这就是为什么我正在寻找更好的build议。 在此先感谢您的帮助。

Xcode PhoneGap navigator.connection未定义

尝试将我的PhoneGap JavaScript代码移植到Xcode中以在iOS中进行debugging。 使用Cordova-3.0.0。 当我打电话时: navigator.connection.type 我得到一个'undefined'的navigator.connection。 我没有正确地在我的config.xml中包含networking连接插件,或者是其他的错误? 是的,我包含了专门针对iOS的正确的cordova.js文件。 是的,deviceready已经被解雇了。 更新:我目前只在iOS模拟器上运行。 我的config.xml: <?xml version='1.0' encoding='utf-8'?> <widget id="com.app.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Hello Cordova</name> <description> Description </description> <author email="dev@callback.apache.org" href="http://cordova.io"> Apache Cordova Team </author> <access origin="*" /> <preference name="fullscreen" value="true" /> <preference name="webviewbounce" value="true" /> <plugins> <plugin name="NetworkStatus" value="CDVConnection" /> </plugins> </widget> 感谢您的帮助!

Core-Data executeFetchRequest在后台线程中冻结App

我有一个saveMOC的直接父母的mainMOC ,我需要在线获取另一个tmpMOC为了不阻止我的用户界面,同时从互联网上获取大量的logging。 我的应用程序冻结。 我可以缩小到这一点: fetchedItems = [tmpMOC executeFetchRequest:fetchRequest error:&error]; 我试图把这封装在dispatch_sync , [moc.parentcontext.parentcontext.persistentStoreCoordinator lock/unlock] , [whatevermoc performBlockAndWait] … 我也试图取出_mainMOC …没办法… 我明白, executeFetchRequest是不是线程安全的,所以,我怎么locking我需要locking,以确保我没有插入一个双? 任何人都可以帮忙? 更新(1) AppDelegate中的_saveMOC实例: – (NSManagedObjectContext *)managedObjectContext { if (_mainMOC != nil) { return _mainMOC; } if (_saveMOC == nil) { NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { _saveMOC = [[NSManagedObjectContext alloc] […]

转换iPad应用程序到iPhone应用程序?

我写了一个基于标签的iPad应用程序,做得很好。 我从来没有打算成为一个iPhone应用程序,因为它显示的内容真的不适合这样一个小屏幕。 不过,我也得到了很多与iPhone兼容的应用程序的要求。 有人可以指向我的一些文件的方向,可以帮助我弄清楚如何转换我的应用程序。 我认为这并不像为iPhone另一套XIB文件那么简单,只要在应用程序运行在手机上就显示它们。

以编程方式断开或连接iPhone电话

我正在为iOS进行个人调整。 我想在手机显示任何内容之前断开/连接电话。 我钩入类SBUIFullscreenAlertAdapter的initWithAlertController:方法。 一切都好,当我只显示一个消息,显示传入的电话号码和它的名字,但是当我尝试接听电话或断开它编程,它会崩溃,并进入安全模式。 这是我的代码: @interface SBUIFullscreenAlertAdapter – (id)initWithAlertController:(id)arg1; @end @interface MPIncomingPhoneCallController { struct __CTCall *_incomingCall; } – (id) incomingCallNumber; – (void)stopRingingOrVibrating; – (void)answerCall:(struct __CTCall *)arg1; @end %hook SBUIFullscreenAlertAdapter – (id)initWithAlertController:(id)arg1 { MPIncomingPhoneCallController *phoneCall = (MPIncomingPhoneCallController*)arg1; [phoneCall stopRingingOrVibrating]; if([phoneCall.incomingCallNumber isEqualToString:@"+98………."]) { [phoneCall answerCall:_incomingCall]; } %orig; return self; } %end 错误是它说:“使用未声明的标识符_incomingCall'”。 我该如何解决这个问题? 有一种方法来挂钩一个方法时使用私有实例variables? 有没有一个函数返回来电的CTCallRef* ? 有没有其他的方法来完成这个? […]

Swift 3 – 发送同步http请求

我有以下代码: func completeLoadAction(urlString:String) -> Int { let url = URL(string:urlString.trimmingCharacters(in: .whitespaces)) let request = URLRequest(url: url!) let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data, error == nil else { // check for fundamental networking error print("error=\(error)") let ac = UIAlertController(title: "Unable to complete", message: "The load has been […]

模拟UIScrollView减速

我有一个UIPanGestureRecognize ,我用它来改变视图的框架。 有一种方法来模拟手势的状态是UIGestureRecognizerStateEnded UIScrollView或UITableView的减速? 这是我现在的代码: if (panGesture.state == UIGestureRecognizerStateEnded) { [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{ self.view.frame = CGRectMake(182, 0, self.view.frame.size.width, self.view.frame.size.height); } completion:^(BOOL finished) { if (finished) { //Do something } }]; } 但这不是一个光滑的滚动。 我想要一些减速的东西,直到它停止到我设定的点。 谢谢

以swift语法更新每一天

在一个报价应用程序工作,作为一个初学者,我决定排除在我的应用程序中使用CoreData和Sqlite。 所以我决定尝试一个集合,并更改文本标签。我有一个集合存储在一个数组中。 我试图实现文本每24小时更换一次,并在美国东部时间上午8:00(所以从上午8点到上午8点)发生变化。我希望轮廓是类似于 quoteindex = 0 if(time_elasped:24 hours something about 8:00 AM EST) { quote.text = quoteCollection.quoteArray[quoteIndex] quoteindex++ (next quote in array) } 我将如何按照语法组织这样的事情? 我会用另一个循环吗?

PFObject值可能没有class:UIImage

我有一个名为PFGiveItem PFObject的子类。 @interface PFGiveItem : PFObject <PFSubclassing> +(NSString *)parseClassName; @property (strong, nonatomic) NSString *giveItemName; @property (strong, nonatomic) UIImage *giveItemImage; @end 当我尝试查询已保存到Parse的图像,然后将图像保存到我的每个GiveItem中时,出现错误。 这是包含自己的PFQuery的较大循环的一部分; 我只是隔离这部分,以保持简单,因为其余的工作。 PFQuery *queryForRelatedImages = [PFQuery queryWithClassName:@"giveItemPhoto"]; [queryForRelatedImages whereKey:@"objectId" equalTo:@"pAwHU2e7aw"]; [queryForRelatedImages findObjectsInBackgroundWithBlock:^(NSArray *photos, NSError *error) { PFFile *imageFile = photos[0][@"imageFile"]; NSLog(@"%@", imageFile); [imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) { if (!error){ newGiveItem.giveItemImage = [UIImage imageWithData:data]; […]

如何使用Swift在IOS应用程序中整合FitBit Api

首先,我在https://www.fitbit.com创build了一个帐户然后我在https://dev.fitbit.com关心了一个应用程序,然后使用cocoa pods安装了OAuthSwift,并在我的AppDelegate中实现了这个方法 func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { if (url.host == "oauth-callback") { OAuthSwift.handleOpenURL(url) } return true } 现在我想要获得我在https://www.fitbit.com创build的用户帐户的数据(名称,步骤等),我该怎么做? 我search,但无法findfitbit集成的任何教程。 以及在我的代码中使用这些信息的地方? 所以请引导我下一步该怎么做才能获取数据。