Re: Cancelling state restoration on iOS

2017-07-25 Thread Sixten Otto
You can set a custom restorationClass on a per view controller basis, passing the process of instantiating the controller during restoration through your own code that knows how to check whether the document is still there. (We do something similar in our app in some places to make sure that our Co

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Sixten Otto
On Wed, Jan 27, 2016 at 10:29 AM, Jens Alfke wrote: > I believe that text refers to an *SSL* server "with no certificate, or a > self-signed, expired, or hostname-mismatched certificate”. There is a > _separate_ key that allows non-SSL connections. > Reading over the rest of the page, I'm fairly

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Sixten Otto
On Tue, Jan 26, 2016 at 11:18 PM, Jens Alfke wrote: > I believe you’re using the wrong key. If you need non-SSL connections to > work, the key you want is NSAllowsArbitraryLoads. The key you’re using is > for situations where you make an SSL connection but the SSL server doesn’t > meet ATS’s secu

Re: Custom UIViewController transitions with segues

2015-12-30 Thread Sixten Otto
Are you maybe looking for the UINavigationControllerDelegate method that lets you provide an animation controller for the push? That appears to be the way one hooks into the operation of the navigation controller in order to override the default animations. https://developer.apple.com/library/ios/

Re: Problem loading a CoreDataModel from a Static library in Swift

2015-12-15 Thread Sixten Otto
You might want to include some of your code for loading the model, to make this discussion less hypothetical. Also, when you say that "ObjC works just fine", what does that mean? Objective-C code in the same app that's trying to load the same model that Swift code in that app can't load? Or some s

Re: Is it possible to transfer data by using light

2015-09-21 Thread Sixten Otto
On Sun, Sep 20, 2015 at 9:55 PM, Jens Alfke wrote: > But honestly, if you're going this route, it will be much faster to > transmit QR codes, since each code contains thousands of bits. > Especially given that recent versions of iOS can detect and decode QR codes automatically, much like face de

Re: Improve performance of data structure saved to disk

2015-08-06 Thread Sixten Otto
On Thu, Aug 6, 2015 at 9:31 AM, Jens Alfke wrote: > As far as I know, there’s no good Cocoa solution for super-simple > persistence — something like a persistent NSDictionary that can efficiently > store any number of keys. This would be pretty easy to implement using a > bare-bones key/value sto

Re: C Sharp?

2015-07-14 Thread Sixten Otto
On Tue, Jul 14, 2015 at 10:48 AM, Dave wrote: > Does anyone know of a tool/framework that allows C# code to be compiled > and called from Cocoa? > You mean like http://xamarin.com/platform ? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: Anyone recommend Dash?

2015-07-09 Thread Sixten Otto
On Thu, Jul 9, 2015 at 12:02 AM, Roland King wrote: > I did get an update the other day which just told me a new version is on > the way, or just released perhaps. I think I have Dash 2, this is Dash 3 > and is an extra 10 bucks which I will probably end up paying eventually. > How that works thr

Re: Getting a server to trust the client. (iOS)

2015-06-22 Thread Sixten Otto
Using client-side certificates in TLS is pretty standard stuff, and should be well-supported by the system. You might start here: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html The biggest issue with something like thi

Re: 'nuther dumb question

2014-05-16 Thread Sixten Otto
On Fri, May 16, 2014 at 4:46 PM, William Squires wrote: > Why doesn't NSData have a +[NSData dataWithString:(NSString *)] or > -[NSData initWithString:(NSString *)] method? i.e. how do I convert the > contents of an NSString object into an NSData object? Try -[NSString dataUsingEncoding:] or -

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Sixten Otto
On Tue, Mar 18, 2014 at 5:30 PM, William Squires wrote: > My best guess is to: > > 1) Make an ObjC class, and have it implement those methods that subclasses > don't have to override. For those the subclasses must override, implement a > stub that raises an exception if a message is sent to it (as

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Sixten Otto
On Wed, Mar 19, 2014 at 12:38 AM, Luther Baker wrote: > On Wed, Mar 19, 2014 at 12:14 AM, Sixten Otto wrote: > >> The significant difference, though, between an abstract class in Java or >> > C#, and a protocol in Objective-C, is that the former may have substantial >>

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Sixten Otto
On Tue, Mar 18, 2014 at 7:29 PM, Luther Baker wrote: > A _better_ analogy to an Objective-C @protocol would be a formal Java > interface. > Sure. And the same in C# (which the OP was asking about). > So, Kyle may have good reasons for his answer - but if I understand the > essence of your ques

Re: "No options" constant

2014-03-14 Thread Sixten Otto
On Thu, Oct 17, 2013 at 5:05 PM, Sixten Otto wrote: > Let me be clear: I'm not talking about borrowing the "none" constant from > Enumeration A and using it when calling something that expects values from > Enumeration B. I agree that that would be confusing, and possib

Re: Two kinds of NSManagedObject fault?

2014-03-07 Thread Sixten Otto
appen in other circumstances). On Fri, Mar 7, 2014 at 2:47 PM, Rick Mann wrote: > > On Mar 7, 2014, at 13:44 , Sixten Otto wrote: > > > FWIW: trying to access a managed object that has been deleted, but to > which something still has a reference, can produce symptoms like the

Re: Two kinds of NSManagedObject fault?

2014-03-07 Thread Sixten Otto
FWIW: trying to access a managed object that has been deleted, but to which something still has a reference, can produce symptoms like the second kind of access you describe. Sixten On Fri, Mar 7, 2014 at 2:21 PM, Rick Mann wrote: > It seems that objects can be faulted in two ways. In the firs

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Sixten Otto
First off, you don't need to build the string ahead of time; NSLog() supports vararg formatting: NSLog(@"<%@> -(void)myMethod", myClassName); Off the top of my head, I can't recall whether Class objects get formatted as the class name automatically: NSLog(@"<%@> -(void)myMethod", [self cla

Re: NSPredicate speed improvement?

2014-03-02 Thread Sixten Otto
library object loaded.) Sixten On Sat, Mar 1, 2014 at 8:33 AM, Koen van der Drift < koenvanderdr...@gmail.com> wrote: > You are right about the [cd], which is not supposed to be here, blame it > on poor copy-paste skills. > > So how can I fix the predicate to compare entities

Re: NSPredicate speed improvement?

2014-03-01 Thread Sixten Otto
Two things: 1. No, doing a string comparison with contains (and case and diacritical folding active) is one of the slower kinds of string comparison. Straight equality should be much faster. 2. You say that there are two entities, with a relationship defined. Why, then, are you doing a string com

Re: NSFetchedResultsController sort on synthesized property?

2014-02-27 Thread Sixten Otto
The fetched results controller needs to be able to do its sorting in the database (assuming a SQLite store). The section keypath itself doesn't necessarily need to be a persistent property, as long as its values match the ordering of the sort descriptors. (For instance: a table that sections the re

Re: Any way to determine where a string will be truncated?

2014-01-17 Thread Sixten Otto
WDC 2013 session 220 has some info > about iOS's version of this which is very similar to Cococa's. > > TJ > > > On Fri, Jan 17, 2014 at 10:43 AM, Sixten Otto wrote: > >> Using the methods in the UIStringDrawing category on NSString, it's pretty >> str

Any way to determine where a string will be truncated?

2014-01-17 Thread Sixten Otto
Using the methods in the UIStringDrawing category on NSString, it's pretty straightforward to measure the size of a string as it will appear on screen, or to draw it into some constrained area. And I love that UIKit handles all of the logic to truncate the string to fit. But I find myself in a sit

Re: UIPopoverController and UIToolbar interactions

2014-01-13 Thread Sixten Otto
> Gideon > > On 14 Jan 2014, at 8:28 am, Sixten Otto wrote: > > > I tend to agree that it's problematic, but it is deliberate. From the > > documentation: > > > > > … > > > ___ Cocoa-dev mailing list (Coc

Re: UIPopoverController and UIToolbar interactions

2014-01-13 Thread Sixten Otto
I tend to agree that it's problematic, but it is deliberate. From the documentation: Discussion When presenting the popover, this method adds the toolbar that owns the button to the popover’s list of passthrough views. Thus, taps in the toolbar result in the action methods of the corresponding to

Re: "No options" constant

2013-10-17 Thread Sixten Otto
On Thu, Oct 17, 2013 at 3:15 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > Yeah. It seems to me there are two prime reasons to use a specific > constant: > But I'm explicitly talking about APIs where there exists no such constant, and calling code would generally use a litera

Re: "No options" constant

2013-10-17 Thread Sixten Otto
On Thu, Oct 17, 2013 at 11:22 AM, Seth Willits wrote: > I would be hesitant to get used to such a constant. > I'll bite: why? > Many APIs have their own constants for default options. (Search for > DefaultOptions, OptionsDefault, NoOptions, and OptionsNone.) > Obviously. And those generally s

"No options" constant

2013-10-17 Thread Sixten Otto
This has been driving me crazy, and hopefully someone on the list will know off the top… I remember coming across a reference somewhere recently to a constant defined in Foundation or Core Foundations (I think!) that has a zero value, and semantically means "I choose no options". Something that wo

Re: NSAttributedString mysteriously truncated too soon

2012-11-08 Thread Sixten Otto
Out of curiosity, does it matter if you change this line: [content addAttribute:NSParagraphStyleAttributeName value:para range:NSMakeRange(title.length,1)]; to this? [content addAttribute:NSParagraphStyleAttributeName value:para range:NSMakeRange(title.length,blurb.length)]; I don't know that

Re: iOS kiosk mode?

2012-11-05 Thread Sixten Otto
On Sun, Nov 4, 2012 at 12:25 AM, Rick Mann wrote: > Ah, interesting! Still doesn't go quite as far as I want Apple to go: I want > a power-cycled device to skip Springboard and launch my app. I want the > watchdog to kill and restart my app. > Check out the Lock to App feature available with iO

Re: Formatting a set of NSDecimalNumber values

2012-08-10 Thread Sixten Otto
On Fri, Aug 10, 2012 at 10:46 AM, Kyle Sluder wrote: > Don't forget bout languages where numbers read right-to-left. Like which? (I had, shamefully, completely forgotten r-t-l text in this scheme. But some casual googling leads me to believe that Hebrew and Arabic, at least, write numbers in big-

Re: Formatting a set of NSDecimalNumber values

2012-08-10 Thread Sixten Otto
10, 2012, at 8:58 AM, Sixten Otto wrote: > > In order to make the columns line up, and to know how much space I'll > need, what I'd like to do is to figure out, for each set of numbers, > the width of the format I'll need. In other words, the maximum number > of integer

Formatting a set of NSDecimalNumber values

2012-08-10 Thread Sixten Otto
I'm working on an app where I need to take several sets of numeric values (currently stored as NSDecimalNumber), and display them in columns. Each set will have approximately the same magnitude, but the magnitude of each set may change, and I won't know ahead of time what they are. So one might be

Re: Forcing Core Data to save attribute changed behind its back?

2012-07-24 Thread Sixten Otto
On Tue, Jul 24, 2012 at 11:27 AM, Sean McBride wrote: > Yes. My object is a subclass of NSObject and I don't override isEqual:. As > I test, I overrode it and always return NO. At first, I thought this did the > trick, since Core Data passed through this and saved properly; but alas, it > on

Re: Forcing Core Data to save attribute changed behind its back?

2012-07-24 Thread Sixten Otto
On Mon, Jul 23, 2012 at 3:03 PM, Sean McBride wrote: > when I change it, instead of the usual setAttribute:newValue I mutate the > object directly. > - will/didChangeValueForKeyPath: but that's not a sufficient 'kick' Out of random curiousity, does this big mutable object you're updating change

Re: Tab Bar Item naming convention?

2012-07-09 Thread Sixten Otto
On Thu, Jul 5, 2012 at 10:31 PM, Laurent Daudelin wrote: > But, do I follow the same naming convention as for the app icon by adding a > "@2x" to the file name? Absolutely. That's a general convention for naming hidpi resources. https://developer.apple.com/library/ios/documentation/2DDrawing/Co

Re: Index in only one section of UITableView

2011-11-30 Thread Sixten Otto
On Wed, Nov 30, 2011 at 7:59 PM, James West wrote: > Is it possible to override the default behavior of the UITableView index so > it only shows over the right side of a subsection of a table - scrolling with > it, etc? Yeah, that really isn't how the index works at all (even leaving out the pa

Re: Storyboard scene and UIViewController

2011-11-03 Thread Sixten Otto
On Thu, Nov 3, 2011 at 12:40 PM, Eric E. Dolecki wrote: > Then in my code: > > UIStoryboard *storyboard = [UIStoryboard storyboardWithName: > @"MainStoryboard" bundle:[NSBundle mainBundle]]; > HomeUIViewController *hv = [storyboard > instantiateViewControllerWithIdentifier:@"deanna"]; > [splitView

Re: Core Data Xcode 4 question

2011-09-01 Thread Sixten Otto
On Thu, Sep 1, 2011 at 2:56 PM, Andrew Kinnie wrote: > Last I looked at mogenerator, it didn't support Xcode 4. mogenerator supports Xcode 4 just fine (it's the command-line tool). It's Xmo'd (the Xcode plugin) that no longer works. So, you need to regenerate the code manually when you change the

Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Fri, Aug 19, 2011 at 1:14 PM, Steve Christensen wrote: > Is there any reason why you can't put the downloaded file in your app's > private cache directory (...//Library/Caches), i.e., what gets > returned by NSSearchPathForDirectoriesInDomains(NSCachesDirectory, > NSUserDomainMask, YES)? That

Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:14 PM, Quincey Morris wrote: > c. Can you show us the actual line of code that does the replacement? Here's the original code (plus the addition of an assert on the file manager). The property self.filePath has the path to the current version of the file that's already

Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:38 PM, Ken Thomases wrote: > My thinking is that -replaceItemAtURL:... is a wrapper around > exchangedata() or FSExchangeObjects(). Those functions, and the general > operation that they perform, require that the files to be exchanged be on > the same file system. It

Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:14 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > a. What version of iOS did this fail on? > The 4.3 simulator (running on Snow Leopard, Xcode 4.0.2). > b. Can you assert that the receiver of the 'replace…' method is not nil? > (If it was nil, the

Strange NSFileManager file replacement issue

2011-08-18 Thread Sixten Otto
I have an iOS app where I'm storing files in the app's Documents directory, and occasionally downloading new versions from the server to replace them. The actual code is split across a number of files and classes, but the end of the process goes like this: - The download of the new data to a tempo

Re: Implementing async notifications

2010-12-10 Thread Sixten Otto
On Fri, Dec 10, 2010 at 2:50 PM, Jon Sigman wrote: > I have a Cocoa app that uses a dedicated thread to receive messages, and I > would > like that thread to post those messages as notifications so they can be > processed asynchronously, outside my receiving loop (but not on the main > thread). >

Re: Call web service from iPhone [use soap]

2010-12-09 Thread Sixten Otto
On Thu, Dec 9, 2010 at 6:20 AM, ico wrote: > I want to develop an iPhone app which will consume a soap web service. > I tried to use wsdl2objc (http://code.google.com/p/wsdl2objc/) to generate > the Objective C stub codes, they can be compiled but it does not work. > You say that it doesn't work

Re: Help tracking down a dangling pointer?

2010-06-10 Thread Sixten Otto
On Thu, Jun 10, 2010 at 1:41 PM, Greg Parker wrote: > If you suspect a use-after-free bug somewhere, and NSZombie doesn't find it, > then try this: > 1. Verify that NSZombie is operating. Add `NSMutableString alloc] init] > release] release]` to your code. Make sure NSZombie catches it. Wel

Help tracking down a dangling pointer?

2010-06-10 Thread Sixten Otto
There are many, many questions and articles and discussions out there about tracking down memory leaks, and finding over-release bugs. Neither of those, AFAICT, is what's happening to me. If there's a good article or Fine Manual out there that I should read, I haven't found it. In my iPhone app, I

Re: Writing an NNTP client

2010-06-01 Thread Sixten Otto
On Tue, Jun 1, 2010 at 9:57 AM, Uli Kusterer wrote: >  I think there are also some open source NNTP clients out there > (Newswatcher for example, but I don't know what license it's under When I was poking around fairly recently, it appeared that most of the Open Source apps for Mac were, in fact,

Re: POST request on iPhone

2010-06-01 Thread Sixten Otto
On Tue, Jun 1, 2010 at 6:03 AM, Joshua Tucker wrote: > has anyone got any sample code for a POST request for interfacing with an API > such as the DirectAdmin API? I believe the usual StackOverflow answer is to consider ASIHTTPRequest, which gives a somewhat higher-level API than NSURLConnection

Re: Getting TextEdit to Recognise UTF-8 Output

2010-05-21 Thread Sixten Otto
On Fri, May 21, 2010 at 3:42 PM, K.Darcy Otto wrote: > I've tried prefacing the text file with a BOM in this way: You may well already know this, and that may be something you're attempting out of desperation, but: "The endian order entry for UTF-8 in Table 2-4 is marked N/A because UTF-8 code u

Re: CCHmacInit - key?

2010-05-10 Thread Sixten Otto
On Mon, May 10, 2010 at 12:28 PM, Patrick M. Rutkowski wrote: > I'm really not getting what the "key" argument to CCHmacInit() is > supposed to be. I'm trying to implement oauth linked-in integration, Not really an answer to your question, but are you trying to implement OAuth from scratch? Is th

Re: Floating window on iPhone OS?

2010-04-28 Thread Sixten Otto
On Wed, Apr 28, 2010 at 6:11 PM, Laurent Daudelin wrote: > I've seen in a few apps a little rounded corners status window appearing > [snip] > Anybody knows how to do that? http://github.com/jdg/MBProgressHUD ? Sixten ___ Cocoa-dev mailing list (Coco

Re: NSXML and invalid UTF8 characters

2010-01-28 Thread Sixten Otto
On Thu, Jan 28, 2010 at 6:16 PM, Keith Blount wrote: > I am using the NSXML classes to generate and parse my own XML files. > Sometimes these files store strings of text that has been brought in from > other applications (for instance, there might be a plain text representation > of some text t

Re: NSDictionary trouble

2010-01-19 Thread Sixten Otto
On Tue, Jan 19, 2010 at 1:24 PM, Jens Alfke wrote: > On Jan 19, 2010, at 8:53 AM, Shawn Rutledge wrote: >> I didn't try CFDictionary yet; is that appropriate for an iPhone app? > > But try NSMapTable first. It's sort of halfway between the two — it's an > Objective-C class but it has greater flexi

Re: function/library to pack javascript?

2010-01-18 Thread Sixten Otto
On Mon, Jan 18, 2010 at 3:17 AM, Eric Boo wrote: > I'm trying to find a C/Objective-C function or library that will help me > pack javascript, something like YUI Compressor or Dean Edwards's packer. It may not be as aggressive as you'd like, but Doug Crockford's jsmin has C source code available:

Re: Architecture for concurrent network client

2009-09-21 Thread Sixten Otto
On Mon, Sep 21, 2009 at 4:58 PM, Jens Alfke wrote: >> connections available to the application. Somehow I need to track >> which/how many connections are idle, and dequeue requests to those >> connections. > > Just keep a mutable array of free connections. As I think about it more, I think you ma

Re: an app that never quits

2009-09-21 Thread Sixten Otto
On Mon, Sep 21, 2009 at 4:15 PM, Erick Calder wrote: > ok, perhaps there's another way I can solve my problem.  I have a little app > called Trapster that uses something called "push technology"... I think what > it means is that some server can send my app a signal and even though the > app isn't

Re: Architecture for concurrent network client

2009-09-21 Thread Sixten Otto
On Mon, Sep 21, 2009 at 12:20 PM, Jens Alfke wrote: > You don't need concurrency or threads to handle socket connections. The 'Mac > way' is to use asynchronous I/O, hooking up the socket connections to the > runloop and getting callbacks when data is available. That's true, and I knew better tha

Architecture for concurrent network client

2009-09-21 Thread Sixten Otto
I'm trying to work out in my head the best way to structure a Cocoa app that's essentially a concurrent download manager. There's a server the app talks to, the user makes a big list of things to pull down, and the app processes that list. (It's not using HTTP or FTP, so I can't use the URL-loading