cocoa-touch

Core Data not automatically calling value transformer when getting / setting attribute directly in code

风流意气都作罢 提交于 2020-01-04 09:46:46
问题 If I understand correctly, the idea behind Core Data transformable attributes is: implement an NSValueTransformer subclass with returns [NSData class] in +transformedValueClass along with its implementation for transformation register the transformer in +load or +initialize set an entity's attribute as transformable set a name for your transformer (the name you used to register it) in the xcode model editor for the attribute. At this point, I'd expect that accessing or setting the attribute

Core Data not automatically calling value transformer when getting / setting attribute directly in code

佐手、 提交于 2020-01-04 09:42:13
问题 If I understand correctly, the idea behind Core Data transformable attributes is: implement an NSValueTransformer subclass with returns [NSData class] in +transformedValueClass along with its implementation for transformation register the transformer in +load or +initialize set an entity's attribute as transformable set a name for your transformer (the name you used to register it) in the xcode model editor for the attribute. At this point, I'd expect that accessing or setting the attribute

Clear NSURLSession Cache

这一生的挚爱 提交于 2020-01-04 09:39:10
问题 I'm using NSURLSession to perform an HTTP Post NSMutableURLRequest , using the dataTaskWithRequest:completionHandler: method. When I perform a request for the first time, things take a reasonable amount of time to complete and show some feedback in the completion handler. On the next time that same request is fired, it happens almost instantaneously with very little time in between, which leads me to believe that the system is caching the contents of this data task. As I don't need to view

Clear NSURLSession Cache

限于喜欢 提交于 2020-01-04 09:39:04
问题 I'm using NSURLSession to perform an HTTP Post NSMutableURLRequest , using the dataTaskWithRequest:completionHandler: method. When I perform a request for the first time, things take a reasonable amount of time to complete and show some feedback in the completion handler. On the next time that same request is fired, it happens almost instantaneously with very little time in between, which leads me to believe that the system is caching the contents of this data task. As I don't need to view

UIView drawRect vs initWithFrame

六眼飞鱼酱① 提交于 2020-01-04 09:17:08
问题 I have a UIView which has several buttons added to it as subviews. Currently I have the buttons in drawRect:, which I have heard is a bad idea because drawRect can be called several times. I tried to move these UIButtons to initWithFrame, but they just don't get drawn. How should I fix this? I am not using interface builder, so there are no NIB files present. The initWithFrame is called. I checked by adding an NSLog(...), and my NSMutableArrays are being properly initialized. My initWitFrame:

AVAudioRecorder and AirPlay Mirrioring

自闭症网瘾萝莉.ら 提交于 2020-01-04 08:06:07
问题 When I have an AVAudioRecorder Session active - (when I'm recording audio) I can't activate AirPlay mirroring on the device. Airplay mirroring just deactivates while the app is running and switches it back on when the app exits. This post seems to suggest there is no way around this. My thoughts are to try: using a lower level recording framework or outputting a separate window to external display, rather than mirroring (I've tried this, it doesn't work). Is there another way around this, or

AVAudioRecorder and AirPlay Mirrioring

别等时光非礼了梦想. 提交于 2020-01-04 08:06:07
问题 When I have an AVAudioRecorder Session active - (when I'm recording audio) I can't activate AirPlay mirroring on the device. Airplay mirroring just deactivates while the app is running and switches it back on when the app exits. This post seems to suggest there is no way around this. My thoughts are to try: using a lower level recording framework or outputting a separate window to external display, rather than mirroring (I've tried this, it doesn't work). Is there another way around this, or

Licensing system for static library

一个人想着一个人 提交于 2020-01-04 08:05:45
问题 I'd like to sell a static library for Cocoa Touch apps but want to protect it from being freely distributed. Has anyone tried this or have suggestions on a scheme(s) that I can build to handle it? One example from the desktop world is a vendor sending a license key to you after purchasing the library. That key must be embedded in your app, which is what the library will look for at runtime. The problem is anyone can post the library and key on the web. 回答1: Build a strong fast key-generator

How can i Get container UITableView in a cell of the TableView

喜你入骨 提交于 2020-01-04 07:55:34
问题 is any way to access the UITableView that contains current UITableViewCell in the cell? 回答1: You can go up the view hierarchy until you find a UITableView: UIView *v = self; while (v && ![v isKindOfClass:[UITableView class]]) v = v.superview; // v now holds the table view, or nil if there isn't one Although you should probably question why exactly the cell is needing to poke at the table view, and whether there is a more straightforward way to do it. 回答2: For iOS 8+: UITableView *tableView =

ios how can user cancel facebook sign in?

拟墨画扇 提交于 2020-01-04 07:13:11
问题 When a user gets to this screen, there is no way to cancel out of it. What can I do? To get this view in the first place I am running: NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: vid, @"link", vid, @"source", vid, @"picture", @"My Place", @"name", @"YouTube Presentation", @"caption", title, @"description", @"Enjoy this Video", @"message", nil]; [app.facebook dialog:@"stream.publish" andParams:params andDelegate:self]; 回答1: This happens if your FBDialog