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

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

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

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.

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

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

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 j...@mooseyard.com 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

Re: C Sharp?

2015-07-14 Thread Sixten Otto
On Tue, Jul 14, 2015 at 10:48 AM, Dave d...@looktowindward.com 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

Re: Anyone recommend Dash?

2015-07-09 Thread Sixten Otto
On Thu, Jul 9, 2015 at 12:02 AM, Roland King r...@rols.org 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

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

Re: 'nuther dumb question

2014-05-16 Thread Sixten Otto
On Fri, May 16, 2014 at 4:46 PM, William Squires wsqui...@satx.rr.comwrote: 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

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 lutherba...@gmail.comwrote: On Wed, Mar 19, 2014 at 12:14 AM, Sixten Otto hims...@sfko.com 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-19 Thread Sixten Otto
On Tue, Mar 18, 2014 at 5:30 PM, William Squires wsqui...@satx.rr.comwrote: 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

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 lutherba...@gmail.com 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

Re: No options constant

2014-03-14 Thread Sixten Otto
On Thu, Oct 17, 2013 at 5:05 PM, Sixten Otto hims...@sfko.com 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 possibly get me

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 rm...@latencyzero.com wrote: It seems that objects can be faulted in

Re: Two kinds of NSManagedObject fault?

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

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 class]);

Re: NSPredicate speed improvement?

2014-03-02 Thread Sixten Otto
, 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? - Koen. On Mar 1, 2014, at 10:22 AM, Sixten Otto hims...@sfko.com wrote: Two things

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

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

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

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

2014-01-17 Thread Sixten Otto
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 hims...@sfko.com wrote: Using the methods in the UIStringDrawing category on NSString, it's pretty straightforward to measure the size of a string

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

Re: UIPopoverController and UIToolbar interactions

2014-01-13 Thread Sixten Otto
On 14 Jan 2014, at 8:28 am, Sixten Otto hims...@sfko.com wrote: I tend to agree that it's problematic, but it is deliberate. From the documentation: … ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

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

Re: No options constant

2013-10-17 Thread Sixten Otto
On Thu, Oct 17, 2013 at 11:22 AM, Seth Willits sli...@araelium.com 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

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 literal

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

Re: iOS kiosk mode?

2012-11-05 Thread Sixten Otto
On Sun, Nov 4, 2012 at 12:25 AM, Rick Mann rm...@latencyzero.com 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

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: Formatting a set of NSDecimalNumber values

2012-08-10 Thread Sixten Otto
, at 8:58 AM, Sixten Otto hims...@sfko.com 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 places, and the maximum

Re: Formatting a set of NSDecimalNumber values

2012-08-10 Thread Sixten Otto
On Fri, Aug 10, 2012 at 10:46 AM, Kyle Sluder k...@ksluder.com 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

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 s...@rogue-research.com 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

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 s...@rogue-research.com 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

Re: Tab Bar Item naming convention?

2012-07-09 Thread Sixten Otto
On Thu, Jul 5, 2012 at 10:31 PM, Laurent Daudelin laur...@nemesys-soft.com 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.

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 jww...@gmail.com 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

Re: Storyboard scene and UIViewController

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

Re: Core Data Xcode 4 question

2011-09-01 Thread Sixten Otto
On Thu, Sep 1, 2011 at 2:56 PM, Andrew Kinnie akin...@mac.com 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

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

Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:38 PM, Ken Thomases k...@codeweavers.com 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

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: 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

Re: Strange NSFileManager file replacement issue

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

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

Re: Implementing async notifications

2010-12-10 Thread Sixten Otto
On Fri, Dec 10, 2010 at 2:50 PM, Jon Sigman rf_...@yahoo.com 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

Re: Call web service from iPhone [use soap]

2010-12-09 Thread Sixten Otto
On Thu, Dec 9, 2010 at 6:20 AM, ico jche...@gmail.com 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

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,

Re: Help tracking down a dangling pointer?

2010-06-10 Thread Sixten Otto
On Thu, Jun 10, 2010 at 1:41 PM, Greg Parker gpar...@apple.com 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

Re: POST request on iPhone

2010-06-01 Thread Sixten Otto
On Tue, Jun 1, 2010 at 6:03 AM, Joshua Tucker joshualeetuc...@googlemail.com 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

Re: Writing an NNTP client

2010-06-01 Thread Sixten Otto
On Tue, Jun 1, 2010 at 9:57 AM, Uli Kusterer witness.of.teacht...@gmx.net 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

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 do...@csusb.edu 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

Re: Floating window on iPhone OS?

2010-04-28 Thread Sixten Otto
On Wed, Apr 28, 2010 at 6:11 PM, Laurent Daudelin laurent.daude...@gmail.com 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 ___

Re: NSXML and invalid UTF8 characters

2010-01-28 Thread Sixten Otto
On Thu, Jan 28, 2010 at 6:16 PM, Keith Blount keithblo...@yahoo.com 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

Re: NSDictionary trouble

2010-01-19 Thread Sixten Otto
On Tue, Jan 19, 2010 at 1:24 PM, Jens Alfke j...@mooseyard.com 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

Re: function/library to pack javascript?

2010-01-18 Thread Sixten Otto
On Mon, Jan 18, 2010 at 3:17 AM, Eric Boo eric...@gmail.com 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

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

Re: Architecture for concurrent network client

2009-09-21 Thread Sixten Otto
On Mon, Sep 21, 2009 at 12:20 PM, Jens Alfke j...@mooseyard.com 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

Re: an app that never quits

2009-09-21 Thread Sixten Otto
On Mon, Sep 21, 2009 at 4:15 PM, Erick Calder e...@arix.com 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

Re: Architecture for concurrent network client

2009-09-21 Thread Sixten Otto
On Mon, Sep 21, 2009 at 4:58 PM, Jens Alfke j...@mooseyard.com 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