草庐IT

post_save

全部标签

ios - RestKit:POST 反序列化 - 预期类型 A 的对象映射,提供者为 B 返回一个

这是我的路由设置:[manager.router.routeSetaddRoute:[RKRouterouteWithClass:[UserProfileclass]pathPattern:@"/api/v1/users"method:RKRequestMethodPOST]];[manager.router.routeSetaddRoute:[RKRouterouteWithClass:[UserProfileAndStatisticsclass]pathPattern:@"/api/v1/profile/:userId"method:RKRequestMethodGET]];[ma

iphone - AFNetworking 在 JSON 中编码 POST 参数?

我有以下代码:APIClient*client=[APIClientsharedManager];NSMutableURLRequest*request=[clientrequestWithMethod:@"POST"path:[NSStringstringWithFormat:@"/look/%@/comment",cid]parameters:[NSDictionarydictionaryWithObjectsAndKeys:text,@"text",nil]];AFHTTPRequestOperation*operation=[[AFHTTPRequestOperationall

iOS 核心数据更新 : changes not saved

我正在尝试在我的iPad应用程序中使用CoreData。我有一个像这样的模型:客户.h#import@interfaceCustomer:NSManagedObject@property(nonatomic,strong)NSString*name;@end客户.m#import"Customer.h"@implementationCustomer@synthesizename;@endTableViewController显示数据库中的所有客户。通过选择客户,启动详细信息View推送segue并设置客户:-(void)prepareForSegue:(UIStoryboardSegu

iOS - NSInternalInconsistencyException 'circular dependency when saving'

你得对我放轻松,因为我还在学习,但我有一次弹出这个线程错误,我点击了“登录Facebook”按钮。这个项目是针对“Tinder”或“HotorNot”的克隆,我仍处于起步阶段。如果有人可以解释我的错误,我将不胜感激......2014-02-1014:27:37.629MatchedUp[38775:70b]***Terminatingappduetouncaughtexception'NSInternalInconsistencyException',reason:'Foundacirculardependencywhensaving.'***Firstthrowcallstack:

iOS 10 : sharing image/save image started crashing

我有一个代码,它通过UIActivityViewController共享一行文本和一张图像。在我更新到iOS10后,它开始崩溃并显示以下日志:Thisapphascrashedbecauseitattemptedtoaccessprivacy-sensitivedatawithoutausagedescription.Theapp'sInfo.plistmustcontainanNSPhotoLibraryUsageDescriptionkeywithastringvalueexplainingtotheuserhowtheappusesthisdata.我没有发布代码,因为它似乎甚至

ios - POST w/JSON Body - Swift3 - 片段?

我只是想通过Swift3httprequest发送一个JSON字符串。尝试使用字典和转义字符串...funcgetToken(successHandler:@escaping(Any)->Void,errorHandler:@escaping(Any)->Void){varrequest=URLRequest(url:URL(string:"http://my-api.domain.com/getToken")!)request.httpMethod="POST"request.setValue("application/json",forHTTPHeaderField:"Conten

python - 如何为要发送 POST 请求的 iPhone 和 Android 应用程序生成 Django CSRF key ?

事情是这样的:现在,在我的网站模板上,有{%csrf_token%}允许我的网站发送表单的POST请求。但是,如果我的iPhone应用程序(客户端)想要向我的Web服务发送POST请求怎么办?如何为我的iPhone应用程序提供一个它可以临时使用的CSRFtoken? 最佳答案 您的目标是重复使用现有表单吗?如果是这样,iPhone应用程序应该使用表单获取页面,然后使用CSRFtoken进行POST。CSRFtoken的全部意义在于服务器必须生成它们。您的目标是验证iPhone应用程序以便其他应用程序无法POST到您的API吗?这是一

ios - 将右栏按钮项从 'Save' 更改为 'Done'

我有一个NavigationItem和一个正确的BarButtonItem,它是标识符-最初-“保存”以保存我在View上创建的实体。在我看来,我使用的是DatePicker。如果此DatePicker可见,则“保存”按钮不应是“保存”按钮,而应是“完成”按钮。如果DatePicker不可见,“完成”按钮应再次更改为“保存”。我理解InterfaceBuilder中的标识符,就像包含本地化一样。所以我想,我不能只更改标题,对吧?你能告诉我如何将按钮从“保存”更改为“完成”吗?否则我该怎么做? 最佳答案 matt是对的-有两个按钮并根

ios - Realm -iOS : Object reference set to nil after save

我有2个类:Company和Employee。两者都继承了RealmObject类。classCompany:Object{varname:String=""varemployee:Employee?overridestaticfuncprimaryKey()->String?{return"name"}}classEmployee:Object{varname:String=""varage:Int=0overridestaticfuncprimaryKey()->String?{return"name"}}填充对象varemp=Employee()emp.name="Sachin"

ios - context?.save(nil) 出现错误

使用Xcode7和swift2.0如果在上下文中出现以下错误?.save(nil)。感谢任何帮助“不能对‘NSManagedObjectContext’类型的非可选值使用可选链funcnewItem(){letcontext=self.contextletent=NSEntityDescription.entityForName("CallList",inManagedObjectContext:context)letnItem=CallList(entity:ent!,insertIntoManagedObjectContext:context)nItem.firstname=fir